Dynamic HTML from Python Script

Mike 42flicks at gmail.com
Tue Jun 10 22:29:44 EDT 2008


On Wed, Jun 11, 2008 at 2:16 PM, asdf <asdf at asdf.com> wrote:

> On Wed, 11 Jun 2008 11:20:48 +1000, Aidan wrote:
>
> > asdf wrote:
> >>> Well, there's a few ways you could approach it.
> >>>
> >>> You could create a cgi program from your script - this is probably the
> >>> solution you're looking for.
> >>>
> >>>
> >> Output from the script does come up very often. There is a new output
> >> every 10 secs and it's possible that the script might be run
> >> indefinitely. Basically I want all that output displayed in a web
> >> browser
> >
> > Well, in that case you could simply append the new output to a static
> > file every 10 seconds, or whenever there is new output.  That way, you
> > just need to refresh the static file in your browser to see updates...
> > Given what I understand of your situation, that's how I'd do it.
> >
> The problem with this is that browser would have to be refreshed manually
> every 10 seconds. Unless there is a way to set this in the script itself.
>
>
> > A constantly running CGI app is probably not the best idea, given
> > timeouts and other such constraints you might run into.
> >
> >
> >>> You could have the script run periodically and create a static html
> >>> file in the webroot... this would be acceptable, maybe preferable, if
> >>> the output from your script doesn't change frequently.
> >>>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Sorry should have asked how often a user would be requesting new content. To
avoid page refreshing I'd look into Django AJAX support, havn't tried it
myself but will be soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080611/d9ebae15/attachment-0001.html>


More information about the Python-list mailing list