quinn at groat.ugcs.caltech.edu
Mon Nov 29 22:28:48 CET 1999
On Mon, 29 Nov 1999 09:47:22 -0700, Bjorn Pettersen <bjorn at roguewave.com> wrote:
>> leon <leonar_n at epita.fr> wrote:
>> > I'm developping an IRC like software which must work on the
>> Web. I can't use
>> > Java, and I'm using Python to program the CGI. But, I have
>> a big problem : I
>> > don't know how to make the stdout unbuffered.
>> > I tried to make some
>> > sys.stdout.write("test")
>> > sys.stdout.flush()
>> > but it don't work.
>> looks fine to me. maybe something else
>> is wrong?
>> anyway, you could try running the inter-
>> preter with the -u option:
>> $ python -?
>> Unknown option: -?
>> usage: python [option] ... [-c cmd | file | -] [arg] ...
>> Options and arguments (and corresponding environment variables):
>> -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
>Note that some webservers automatically buffer cgi output until the cgi
>closes stdout. To the best of my knowledge there are no pretty workarounds
>for this... You should check your webserver's docs to see if this is the
apache 1.3 and on has 'effectively unbuffered' cgi scripts. For apache 1.2
and earlier you can use the nph- hack.
More information about the Python-list