Dynamic HTML from Python Script

Dave Parker daveparker at flamingthunder.com
Thu Jun 12 07:10:41 EDT 2008


On Jun 11, 10:43 pm, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
>         Those are not /server side/ refreshes...

Correct.  But we weren't discussing server side refreshes.  We were
discussing how to make the "browser refresh automatically in the
server side":

On Jun 11, 7:59 am, Lie <Lie.1... at gmail.com> wrote:
> Surely you don't think you can do that without Javascript don't you?
> You can't make the browser refresh automatically in the server side,
> it has to be done in the client side scripting or like Opera browser
> that have an option to make it refresh a page every few seconds.

The example I posted showed a simple way to "make the browser refresh
automatically in the server side" by using an HTTP Refresh header
instead of using any Javascript or client side scripting or setting a
browser option to refresh the page every few seconds.


On Jun 11, 10:43 pm, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Wed, 11 Jun 2008 07:36:59 -0700 (PDT), Dave Parker
> <davepar... at flamingthunder.com> declaimed the following in
> comp.lang.python:
>
> > Yes you can.  I don't know how to do it in Python, but here's an
> > example in Flaming Thunder of a small, fast, light compiled server
> > side CGI that delivers dynamic content every 10 seconds.
>
> >   # Write out the HTTP headers, followed by a blank line.
> >   # Make sure to write CRLF and not just LF, as per HTTP
> >   # specs.  Also, turn off caching using the no-cache and
> >   # expires options, so that caching doesn't conflict with
> >   # refreshes.
>
> >   Set CRLF to CarriageReturn+LineFeed.
> >   Write "Refresh: 10; url=http://www.flamingthunder.com/cgi/
> > refresh.cgi",CRLF.
>
>         Those are not /server side/ refreshes... The first thing being
> written is a command to the browser that tells the browser to reload the
> specified page after a delay period.
>
>         IOWs it is the browser doing the refresh -- which means it starts a
> whole new connection, receiving a page from the CGI script... Said page
> again having a browser command to do a delayed refresh.
>
>         Server side would mean that the server somehow continuously sends
> updates WITHOUT BEING ASKED.
> --
>         Wulfraed        Dennis Lee Bieber               KD6MOG
>         wlfr... at ix.netcom.com              wulfr... at bestiaria.com
>                 HTTP://wlfraed.home.netcom.com/
>         (Bestiaria Support Staff:               web-a... at bestiaria.com)
>                 HTTP://www.bestiaria.com/




More information about the Python-list mailing list