Problem with CGI termination

Kragen Sitaker kragen at dnaco.net
Tue Sep 19 18:06:54 EDT 2000


In article <H5Lx5.463$Sm1.664 at news.more.net>,
Jeff Kunce <kuncej at mail.conservation.state.mo.us> wrote:
>> It is because of the buffered output of your print statement.
>> Use sys.stdout.flush() to force the output to the client and the
>> page will immediately appear.
>
>Also, python can be launched with the -u command line option,
>which sets unbuffered binary output to stdout and stderr.
>This is often useful with CGI.

Keep in mind that even if your script uses unbuffered output, there's
no guarantee your web server will.  Some, including some old versions
of Apache, don't unless you make your script an nph-script.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]



More information about the Python-list mailing list