Terry Reedy wrote: > The doc says "-c <command> > Execute the Python code in command. command can be one or more > statements separated by newlines," > > However, I have no idea how to put newlines into a command-line string.
I imagine that it depends on the shell you are using, but bash on Linux makes it simple: double quotes "..." are like Python's triple-quoted strings in that they can include newlines. [steve@sylar python]$ ls f*.py | python -c "import sys > print sys.stdin.read()" factorial.py fetchqm.py fib.py fileutils.py findsingle.py fixascii.py fix.py frange.py frequencies.py Other shells may be different. -- Steven -- http://mail.python.org/mailman/listinfo/python-list