![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Expert Programmer
|
GET/POST vars in Python
I just started learning Python, and I'm trying to figure out how to access GET/POST form variables. Anyone know? Thanks.
|
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
With... raw sockets? CherryPy? CGI?
... ![]() |
|
|
|
|
|
#3 |
|
Expert Programmer
|
That sounds sorta complicated. Isn't there an easy way to do it? In PHP you can use $_GET['var'] or $_POST['var']...
EDIT: I believe this article covers what I was looking for. Last edited by titaniumdecoy; May 26th, 2006 at 12:36 AM. |
|
|
|
|
|
#4 | |
|
Programming Guru
![]() ![]() |
No... I was asking you what the medium was for attaining the arguments? Are you trying to do it
Quote:
|
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
I'm talking about getting information submitted to a script by an HTML form. If there's an easier/better way to do it than by using the CGI module, I'd be glad to hear about it.
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() |
I know that's what you're talking about, but it would have helped if you said what you're listening to the HTTP packets with. CherryPy, for example, makes this very easy for you. The POST/GET arguments come in directly as arguments to the functions you map to pages. http://cherrypy.org can teach you all about CherryPy.
Raw Sockets you would have to parse yourself. Not sure about CGI. Not aware of any other methods, other then the HTTP module that interfaces to the socket library. |
|
|
|
|
|
#7 |
|
Newbie
|
CGI module is the way to go. Its not too hard, very similiar to PHP besides the import statement.
|
|
|
|
|
|
#8 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
|
|
#9 | |
|
Expert Programmer
|
Thanks DaWei.
Quote:
|
|
|
|
|
|
|
#10 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
I'd be tempted by Django or Turbogears for a project of reasonable size. Smaller projects I'd use PHP for, I think. Perhaps mod_python if it were available. But if you wish to use Python, and your host doesn't have mod_python or FastCGI or whatever, you're pretty much stuck with basic CGI. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|