Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30336
| From | John Gordon <gordon@panix.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Reducing cache/buffer for faster display |
| Date | 2012-09-27 22:25 +0000 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <k42jp3$1nc$1@reader1.panix.com> (permalink) |
| References | <cmuej9-0ml.ln1@murmur.very.softly> <mailman.1522.1348783807.27098.python-list@python.org> |
In <mailman.1522.1348783807.27098.python-list@python.org> Chris Angelico <rosuav@gmail.com> writes:
> On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 <skunkworks@rikishi42.net> wrote:
> > I have these 2 scripts that are very heavy on the file i/o, consume a very
> > reasonable amount of cpu and output their counters at a - very - relaxed
> > pace to the console. The output is very simply done using something like:
> >
> > print "files:", nFiles, "\r",
> >
> >
> > Yet alltough there is no real reason for it, even a pace of a print every
> > 10-30 secs will be cached, only to actually show an output update every 1-2
> > min or so.
> Yup! Just add a call to sys.stdout.flush() after each print.
Isn't terminal output line-buffered? I don't understand why there would
be an output delay. (Unless the "\r" is messing things up...)
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-27 23:57 +0200
Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 08:09 +1000
Re: Reducing cache/buffer for faster display John Gordon <gordon@panix.com> - 2012-09-27 22:25 +0000
Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 08:38 +1000
Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-28 02:05 +0200
Re: Reducing cache/buffer for faster display Chris Angelico <rosuav@gmail.com> - 2012-09-28 18:08 +1000
Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-29 02:31 +0200
Re: Reducing cache/buffer for faster display Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-27 21:46 -0400
Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-29 02:20 +0200
Re: Reducing cache/buffer for faster display Hans Mulder <hansmu@xs4all.nl> - 2012-09-29 14:32 +0200
Re: Reducing cache/buffer for faster display Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-29 14:12 -0400
Re: Reducing cache/buffer for faster display Rikishi42 <skunkworks@rikishi42.net> - 2012-09-28 02:15 +0200
csiph-web