Linux, Python, and pipes

Skip Montanaro skip at mojam.com
Mon Oct 4 11:38:18 EDT 1999


    Preston> Anyone know what's up with pipes and Python on Linux?  It seems
    Preston> that when trying to pipe the output of a Python program, the
    Preston> pipe does not start flowing until the Python program exits.
    Preston> For programs with long running times and lots of log/debug
    Preston> output, that means you can't begin to look at the output until
    Preston> the program terminates.

Preston,

Try running your Python script with the -u flag.  That causes Python to open
stdout and stderr unbuffered.

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...





More information about the Python-list mailing list