Mailing List Archive

Publishing 'live' Python objects
Hi Pythoneers,

I'm looking for advice on the following:

Suppose I have a Python program that essentially does the following:

while 1:
read from stdin
<fancy calculations>
update some buffer objects

I now wish to take a look at snapshots of those buffer objects in
'real-time'. (the program continues running and updating the buffers)
I'd like to do this with HTTP.

Is this possible? I gave Zpublisher a try, but I don't think it can do
what I want. Should I look into using threads?


Thanks,

Camiel
Publishing 'live' Python objects [ In reply to ]
In article <7ekq6v$of7$1@news2.xs4all.nl>, Camiel Dobbelaar
<dobbe@xs3.xs4all.nl> wrote:

> I'm looking for advice on the following:
>
> Suppose I have a Python program that essentially does the following:
>
> while 1:
> read from stdin
> <fancy calculations>
> update some buffer objects
>
> I now wish to take a look at snapshots of those buffer objects in
> 'real-time'. (the program continues running and updating the buffers)
> I'd like to do this with HTTP.

I'd suggest you periodically, during <fancy calculations>, copy the
buffer objects to a file, e.g. with pickle. Then you can have another
Python CGI script read these files and display them upon request.

Cheers,
-- Joe

--
,------------------------------------------------------------------.
| Joseph J. Strout Biocomputing -- The Salk Institute |
| joe@strout.net http://www.strout.net |
`------------------------------------------------------------------'
Check out the Mac Web Directory! http://www.strout.net/macweb.cgi