Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38136

Re: autoflush on/off

From garabik-news-2005-05@kassiopeia.juls.savba.sk
Newsgroups comp.lang.python
Subject Re: autoflush on/off
Date 2013-02-04 18:51 +0000
Organization Aioe.org NNTP Server
Message-ID <keovvg$fjb$1@speranza.aioe.org> (permalink)
References <mailman.1326.1359997988.2939.python-list@python.org>

Show all headers | View raw


Jabba Laci <jabba.laci@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!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

autoflush on/off Jabba Laci <jabba.laci@gmail.com> - 2013-02-04 18:12 +0100
  Re: autoflush on/off garabik-news-2005-05@kassiopeia.juls.savba.sk - 2013-02-04 18:51 +0000
  Re: autoflush on/off Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-02-04 19:24 +0100

csiph-web