how do i disable buffered output, like Perl's '$|=1'?

floR flor_pino at hotmail.com
Sun Jan 14 13:05:58 EST 2001


Not exactly what I meant, I think.
Okay, what I want to do in particular, is to send 'print' commands to the
browser in intervals, without buffering, something like the following:

print 'Content-type: text/html\n\n'
countdown = 10
while countdown:
    print countdown
    countdown = countdown - 1
    sleep(1)

so that the countdown seems to happen in your browser, instead of waiting
for 10 seconds for the string '10 9 8 7 6 5 4 3 2 1' to appear.


> I'm not sure what the perl code means, but perhaps what
> you're looking for is the '-u' parameter to python:  eg
> python -u myscript.py
>
> HTH
>
> --
>
> Emile van Sebille
> emile at fenx.com
> -------------------
>
>
> "floR" <flor_pino at hotmail.com> wrote in message
> news:979490967.23219.0.pluto.d4ee691b at news.demon.nl...
> > I can't find anywhere how I can disable 'buffered output',
> or whatever it is
> > called.
> > In Perl, you simply say $|=1, but in Python?
> > Can anyone help me?
> >
> > TIA,
> > Rolf Raven
> >
> >
>
>





More information about the Python-list mailing list