Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 3rd, 2005, 11:08 AM   #1
cypherkronis
Newbie
 
Join Date: Jun 2005
Posts: 12
Rep Power: 0 cypherkronis is on a distinguished road
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?
cypherkronis is offline   Reply With Quote
Old Jul 3rd, 2005, 2:10 PM   #2
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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:
i looked all through the module index of cgi, its so useless, they dont even list every function
Heh.. am I just seeing stuff there that you're not seeing? There is excellent documentation on the internet that can be accessed via a simple search. You visit that first link, and tell me what you discover.
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC