Can Python work for me?

Alex Martelli aleaxit at yahoo.com
Wed Feb 19 03:47:00 EST 2003


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





More information about the Python-list mailing list