You can try flushing, or reopening with no buffering

sys.stdout.flush()
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)

On Sun, Sep 27, 2009 at 2:20 AM, Dave Angel <da...@ieee.org> wrote:
> kj wrote:
>>
>> Is there any way to specify unbuffered I/O from *within* the code
>> (rather than via the command-line -u flag)?
>>
>> TIA!
>>
>> kynn
>>
>>
>
> When creating a file object, specify a buffer size of zero.  I don't know
> how to change the buffering of a file object that's already been created, as
> stdin, stdout, and stderr are.
>
> DaveA
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to