J
J
JRazor2014-04-23 10:48:12
Python
JRazor, 2014-04-23 10:48:12

How to run python script via url?

Hello.
There was a need to run a script on the server via a URL (passing parameters via GET), but I don’t understand how to do it without Django and the like.
Can you please explain the easiest way to implement this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SilentSokolov, 2014-04-23
@SilentSokolov

If it’s quite simple, then use the standard library to take BaseHTTPServer (or the same sockets), the GET string can be parsed using urlparse.parse_qs , start the server in the background. And when the necessary parameters come in, run the scripts through processes or threads, as you see fit.
Or uwsgi, as advised above.

V
Valentine, 2014-04-23
@vvpoloskin

Run your own mini web server? Or use uwsgi

D
dvska, 2014-04-29
@dvska

Bottle might be the best choice in this case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question