Newbie quesiton: how to pass parameters to a .mpy script as uri queries?
jims@s...
jims@s...
Sun, 07 Jan 2001 09:00:08 -0000
Hi all
I'm a bit of a newbie, and I'm wondering how to go about writing a
Python script (I'm currently using script_handler, and I don;t know
if that's the proper handler to use) that accepts as input parameters
passed in on the URI of a GET request. For example:
http://loopy.metrics.com/gimme.mpy?category=42&item=white
would invoke the gimme.mpy script and pass the argument "category"
with a value of "42" and the argument "item" with the value "white".
I tried writing the .mpy using the Python cgi module (the usual
has_key stuff, see the cgi module docs on python.org), and that does
not seem to work. When I tinker with script_handler.py I see that the
query is being split off from the path by split_path, but nothing is
being done with the query.
It seems to me that there should be a simple way to do this?
thanks
jim