Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread James Thiele
if you invoke python with the -u option the output of print is unbuffered. On Jan 11, 7:04 am, Tommy Grav <[EMAIL PROTECTED]> wrote: > This certainly does work when running the interpreter interactively, > but when inserted into a script it seems to buffer the print statement > and not write it ou

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread reed
> > for i in range(100): > > sys.stdout.write( "\r" + "count ", i,) >> sys.stdout.flush() > > print # done maybe Tommy Grav wrote: > This certainly does work when running the interpreter interactively, > but when inserted into a script it seems to buffer the

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread Tommy Grav
This certainly does work when running the interpreter interactively, but when inserted into a script it seems to buffer the print statement and not write it out to the terminal. How can I force the print statement to not buffer the output? Cheers Tommy On Jan 11, 2007, at 9:22 AM, Fredrik L

Re: Progress count in terminal (Mac OS X)

2007-01-11 Thread Fredrik Lundh
Tommy Grav <[EMAIL PROTECTED]>: >I have a program that does a lot of iterations and would like > to follow its progress by having it print out the current iteration > number as it progresses. How do I do this so that it appears > like a counter that increases in the same place in the terminal > wi

Progress count in terminal (Mac OS X)

2007-01-11 Thread Tommy Grav
I have a program that does a lot of iterations and would like to follow its progress by having it print out the current iteration number as it progresses. How do I do this so that it appears like a counter that increases in the same place in the terminal window? I am using python2.5 on a Mac OSX an