autoflush on/off

garabik-news-2005-05 at kassiopeia.juls.savba.sk garabik-news-2005-05 at kassiopeia.juls.savba.sk
Mon Feb 4 13:51:28 EST 2013


Jabba Laci <jabba.laci at gmail.com> wrote:
> Hi,
> 
> I'd like to set autoflush on/off in my script. I have a loop that is
> checking something and every 5 second I want to print a '.' (dot). I
> do it with sys.stdout.write and since there is no newline, it is
> buffered and not visible immediately.

My solution is sys.stdout.write('.'); sys.stdout.flush()

-- 
 -----------------------------------------------------------
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__    garabik @ kassiopeia.juls.savba.sk     |
 -----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!



More information about the Python-list mailing list