Re: How do I control output buffering on Win32?

2008-08-15 Thread Wojtek Walczak
On Fri, 15 Aug 2008 09:47:34 -0500, Grant Edwards wrote: > When I ssh in to my Windows XP box and run Python apps, output > from "print" and and "sys.stdout.write()" is being buffered so > that none of the output shows up until the program exits. > > From wi

Re: How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
On 2008-08-15, Grant Edwards <[EMAIL PROTECTED]> wrote: >> I'm not sure you can do that from within the program [1]; to >> do it from the outside, set the PYTHONUNBUFFERED environment >> variable to something, or pass "-u" to the interpreter. > > I had seen references to PYTHONUNBUFFERED in my Goo

Re: How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
up until the program exits. >> >>>From within my program how do I set output buffering to either >> line-buffered or un-buffered? [I'm looking for the equivalent >> of the C stdio "setbuf" call.] > > I'm not sure you can do that from within the

Re: How do I control output buffering on Win32?

2008-08-15 Thread Fredrik Lundh
Grant Edwards wrote: When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. From within my program how do I set output buffering to either

How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. >From within my program how do I set output buffering to either line-buffered or un-buff

Re: output buffering

2005-11-11 Thread JD
On 2005-11-11, Larry Bates <[EMAIL PROTECTED]> wrote: > This is something I wrote that might help. > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 > The solutions become better and better. Thanks. > -Larry Bates > > JD wrote: >> Hello, >> >> When reading a large datafile, I wa

Re: output buffering

2005-11-11 Thread Larry Bates
This is something I wrote that might help. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 -Larry Bates JD wrote: > Hello, > > When reading a large datafile, I want to print a '.' to show the > progress. This fails, I get the series of '.'s after the data has been > read. Is ther

Re: output buffering

2005-11-11 Thread skip
jd> When reading a large datafile, I want to print a '.' to show the jd> progress. This fails, I get the series of '.'s after the data has jd> been read. Is there a trick to fix this? As Fredrik indicated, you need to flush the output buffer. You might also want to check out the prog

Re: output buffering

2005-11-11 Thread JD
On 2005-11-11, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "JD" <[EMAIL PROTECTED]> wrote: > >> When reading a large datafile, I want to print a '.' to show the >> progress. This fails, I get the series of '.'s after the data has been >> read. Is there a trick to fix this? > > assuming that you're p

Re: output buffering

2005-11-11 Thread Fredrik Lundh
"JD" <[EMAIL PROTECTED]> wrote: > When reading a large datafile, I want to print a '.' to show the > progress. This fails, I get the series of '.'s after the data has been > read. Is there a trick to fix this? assuming that you're printing to stdout, sys.stdout.flush() should do the trick.

output buffering

2005-11-11 Thread JD
Hello, When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this? Thanks -- http://mail.python.org/mailman/listinfo/python-list