Can Python work for me?

Cameron Laird claird at
Wed Feb 19 15:18:15 CET 2003

In article <b2vga602dl1 at>,
Alex Martelli  <aleaxit at> wrote:
>Adam Rumpke wrote:
>> I had a question asked to me that I cannot answer. I am curious if
>> Python could be used to act as a CGI for a printer web browser
>> interface. This job requires the web/file server to send the users a
>> message telling them the status.
>> FOR EXAMPLE: If I want to print and the printer is jammed a user at
>> home will need to know the printer is not working. I would like the
>> system to send a message via
>> the browser with out the browser constantly reloading. Could Python do
>> this?
>It doesn't matter much what language you use on the server-side
>for this: you want to do something outside the parameters of the
>HTTP protocol, which is based on request/response, i.e. have the
>server "initiate" something -- any architecture allowing that is
>either outside HTTP (thus needs a special browser supporting it)
>or a kludge (e.g, the server might induce the client to refresh
>periodically -- but that would basically boil down to "browser
>constantly reloading", at least, say, in a single frame).
>> Although, I am computer literate I wont be writing the scripts myself.
>> I would like to use Python as an option now, since I see it a
>> promising option for other projects. Having my existing programmers
>> use the Python option should reduce the costs as well.
>> How could this job be done in Python?
>Exactly in the same ways as with any other server-side programming,
>i.e., not well.  It's not a problem of what language you use for
>the server-side task, but of stretching a protocol (HTTP) to use
>well outside of all of its design parameters.

Alex's right.  As always.

However, there are possibilities that just barely can
be interpreted as meeting your expressed requirements.
I'll focus on the "without the browser constantly re-
loading" phrase.  If that visual appearance is key to
you, then, yes, there are several (I once catalogued
seven, though only two or three are strictly available
through CGI) ways to implement what I call a "Web moni-
tor".  They're all rather abuses of HTTP, as Alex says,
but some are legitimately useful in production applica-
tions.  <URL: > and its references,
especially <URL: >.

Cameron Laird <Cameron at>

More information about the Python-list mailing list