[Tutor] Python persistent webserver?

Kent Johnson kent37 at tds.net
Tue Nov 8 12:03:13 CET 2005


Howard Kao wrote:
> Basically I would like to have a program (or server or whatever) take
> an HTTP POST method (which contains some information, maybe even an
> XML file) from a client, process these XML/information, and then
> generate an XML to send back to the client.
> 
> Currently the environment it has to be done under is Apache on Linux. 
> I am thinking that it may have to be a persistent running program... 
> However it seems a daunting task for a Python noob like me.

You can do this with a Python CGI program that runs behind Apache. Apachee will be the 'persistent running program'. Your CGI will be invoked with each POST request. Look at the CGI module docs and google for 'python cgi' for more information.

> 
> Preferably it doesn't need threading and need not to be sophiscated at
> all, as long as it can take the request, process info and send stuff
> back to a client.

With a CGI all the sophisticated stuff is handled by Apache.

Kent

-- 
http://www.kentsjohnson.com



More information about the Tutor mailing list