Python CGI: how to retrieve variables passed by URL

Sean Berry sean_berry at cox.net
Fri Apr 23 01:42:44 EDT 2004


This may help, but not sure if there is a better, built in way.

print os.environ["QUERY_STRING"].split("=")[1]

prints value if I use localhost/cgi-bin/script-name.cgi?variable=value and
this will work... but is there a better way?



"Sean Berry" <sean_berry at cox.net> wrote in message
news:hU1ic.86730$U83.37750 at fed1read03...
> If I go to my cgi python script with
> localhost/cgi-bin/script-name.cgi?variable=value
>
> How do I gather this value?
>
> Thanks in advance.
>
>





More information about the Python-list mailing list