"Dynamic" website content

Alex Martelli aleax at mail.comcast.net
Sat Jan 21 16:05:44 EST 2006


Christoph Haas <email at christoph-haas.de> wrote:

> On Saturday 21 January 2006 20:42, sophie_newbie wrote:
> > To give you a better explaination of what I want, you could visit
> > www.pat2pdf.org.
> >
> > Type in 123456 as the patent number, you see what it does? It tells the
> > user that it is requesting the various TIFF images and then displays
> > the link to the PDF file that it has created.
> 
> Ah, so you are trying to get the page displayed while your CGI is still
> running? Try flushing stdout after you print something. Otherwise the
> output will only be sent when the CGI ends or the buffer is full.

...unless you run Python with the -u option, which makes output
unbuffered (and, if on Windows where it matters, binary).  However, it's
not sufficient to ensure the user's browser will show the messages you
want when you want.  A much more reliable way to achieve that is to use
timed redirects, or an AJAX (Javascript-based) solution.


Alex



More information about the Python-list mailing list