Quickest way to make py script Web accessible

jmdeschamps at gmail.com jmdeschamps at gmail.com
Thu Jan 5 10:04:50 EST 2006


rtilley at vt.edu wrote:
> What is the quickiest and easiest way to make a py script run on a Web
> server? I have access to an Apache Web server running on Linux.
>
> I'm often asked to run some of my scripts on behalf of others. My hope
> is to make a simple Web-based interface where people could run the
> scripts themselves whenever they like... instead of asking me.
>
> I'd rather not rewrite the scripts with PHP. Any tips on a fast, easy
> way of doing this?
>
> Thanks!

If it's just using the web to *run* a python script on the server, then
a simple cgi-script which will spawn a process for other scripts.

You need a web form that permit the user to choose the script he/she
wants executed.

That form will point (action='your_cgi_script.py') to the script who's
job will be to spawn the other script, submitting the user choice.

One HTML page for the script choices and one extra python script to
receive the cgi call, seems easy!

If it doesn't look that way to you, don't hesitate to let it be known,
and on which part...

Jean-Marc




More information about the Python-list mailing list