![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2005
Posts: 12
Rep Power: 0
![]() |
cgi module index.py?var=x how do i retrieve this w/o os module
i know that to retrieve variables from the url in the form of index.py?variable=x i can use the os module and find them in the environment. however, i remember that there was a way to use the cgi function that immediately turns all those variables into python variables. i looked all through the module index of cgi, its so useless, they dont even list every function.. does anyone know how to accomplish this?
|
|
|
|
|
|
#2 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Unless i'm mistaken you don't use the os module for that, for GET you check sys.argv[1] which is where that string is, then parse it into a dictionary or whatever.
For POST you check stdin, which is to where POST data is written. The cgi module provides a nice abstraction to this, allowing you to access the data in a method independant way. Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|