unbuffered partial line output

lynx none at of.your.business
Sat Feb 22 16:33:17 EST 2003


i'm trying to print half a line of status message and have it output to
the screen (and/or file object) with the cursor waiting at the end of the
output. later on, i'll finish up that line with the remaining half-line's
worth of further status output, but in between goes several minutes' worth
of processing.

unfortunately, all the "obvious" ways of printing-without-a-final-\n-
implied seem like they run into buffering issues of some sort - no part of
the line will be output until the second half is done, leaving me to wait
until my processing is completed to see the half-line that's supposed to
tell me it just started.

is there some attribute of sys.stdout i'm supposed to set to get my output
flushed directly to screen, or some other method of outputting text
that'll get around this? i can't seem to find any mention about output
buffering in the documentation. or am i doing something completely worng
without knowing it?

-- 
   PGP/GnuPG key (ID 1024D/3AC87BD1) available from keyservers everywhere
    Key fingerprint = FA8D 5EA4 E7DC 84B3 64BC  410C 7AEE 54CD 3AC8 7BD1
                "...if you can fill the unforgiving minute
                with sixty seconds' worth of distance run..."





More information about the Python-list mailing list