sleep() function, perhaps.

Ryan Spencer jeder at earthlink.net
Tue Nov 25 18:54:02 EST 2003


On Tue, 25 Nov 2003 16:30:14 +0800, Isaac To wrote:
> 
> Without a newline character, the normal sys.stdout writes to a buffer
> and won't try to flush it out.  Try this:
> 
>>>> for i in range(10):
> ...   sys.stdout.write('.')
> ...   sys.stdout.flush()
> ...   time.sleep(.5)
> ...
> ..........>>>
> 
> Regards,
> Isaac.

Hey!

	Wow! Thanks for all the advice guys. To admit, I'm rather new to python,
but I am understanding thus far and working through all the great advice
you've all given. The spinner is actually very cool, I must say. Also, I
thank you Skip for your progress module, I'll play around with that in a
bit for actually working in coherence with the programs actual progress.

But flushing stdout's buffer does the trick, Which I'm really jazzed to
see. I'm still am heading back through all the other stuff that everyone
else has mentioned though, just to improve my knowledge of course.

I must say though, I previously posted this question on an on line message
board and received no feedback in a matter of weeks, and two days on this
newsgroup and BAM! Haha

Well, Thanks again guys, I'm sure I'll be back with other questions later
;)

~Ryan




More information about the Python-list mailing list