Passing variable to python from a url

Mikael Olofsson mikael at isy.liu.se
Thu Dec 9 14:39:12 EST 1999


On 09-Dec-99 Tekhir wrote:
 >  passing a variable in a url like so "script.py?variable=1"  Is there a way
 >  to do this in python?

Try 

import os

Then check dictionary os.environ

For me this dictionary contains the key "QUERY_STRING" - among other 
things. That's under Solaris and webserver Apache.

Good luck!

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    09-Dec-99
Time:    20:31:37

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list