Hello, Dotan

On Wed, 28 Oct 2009 10:26:22 +0200
Dotan Cohen <dotanco...@gmail.com> wrote:
> I should probably expand on this:
> 
> How can I get an array with all the GET variables in Python?
> How can I get an array with all the POST variables in Python?
> How can I get an array with all the COOKIE variables in Python?
> How can I get the request URI path (everything after
> http://[www.?]example.com/)?
> 
> That's all I want: no templates and nothing between me and the HTML.
> The HTTP headers I can output to stdout myself as well.

$python
>>help(cgi)    
>>help(cgitb) 
>>help(Cookie)
>>help(urlparse)
>>help(os.environ)

GET variables: 
-------------------------------------------------------------------------
import os,cgi
if os.environ.has_key('QUERY_STRING'):
        getv = cgi.parse_qs(os.environ['QUERY_STRING'])
        print getv.keys()

Other examples is very simple too...

-- 
Mikhail M.Smagin <m...@x3.dp.ua>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to