Re: CGI question

2006-01-07 Thread Fuzzyman
An easier way is to use the cgi module. form = cgi.FieldStorage() form is a dictionary like object where each key is the parameter and each entry ahs a 'value' attribute that represents the value. You can use the ``getform`` function from cgiutils to turn it straight into a dictionary. See http:

Re: CGI question

2006-01-06 Thread LordLaraby
sophie, If you have the URL in a variable, it's easy to parse it into it's components (one of which is the query string) like so: >>> from urllib2.urlparse import urlparse >>> urlparse( \ "http://[EMAIL PROTECTED]:8080/mytext.php;hellothere?this=test+value&and=that+one#anchor") ('http', '[EMAIL

Re: CGI question

2006-01-05 Thread Dan Sommers
On 5 Jan 2006 02:54:25 -0800, "sophie_newbie" <[EMAIL PROTECTED]> wrote: > I was wondering if there was a way to extract everyting in the url > after the "?" question mark in one go. [snip] > Is there any easy way of getting the results.cgi program to read this > entire URL (or even just the bit

CGI question

2006-01-05 Thread sophie_newbie
I was wondering if there was a way to extract everyting in the url after the "?" question mark in one go. I have a search page and a results page, and I want the results page to be able to keep a history of what searches have been performed, but there is always a different number of search terms s

Re: CGI question

2005-12-01 Thread Istvan Albert
> I'm still wondering though, if there's some part of the python standard > modules that will convert those % escapes to ASCII or similar - and I believe that functionality is provided by the quote/unquote functions in the urllib module: http://www.python.org/doc/current/lib/module-urllib.html I

Re: CGI question

2005-12-01 Thread Dan Stromberg
On Tue, 29 Nov 2005 12:53:26 -0800, Istvan Albert wrote: > See urlparse: > > http://www.python.org/doc/current/lib/module-urlparse.html This looks like precisely what I need for part of what I need to do. I'm stoked that it knows how to take apart the "?" stuff. I'm still wondering though, if

Re: CGI question

2005-11-30 Thread Fredrik Lundh
Dan Stromberg wrote: > >> What's the best way of converting this: > >> > >> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 > >> 14:48' > >> > >> ...to something easily usable in a python CGI script? > > > > easily usable for what purpose? > > > > if you w

Re: CGI question

2005-11-29 Thread Istvan Albert
See urlparse: http://www.python.org/doc/current/lib/module-urlparse.html -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI question

2005-11-29 Thread Dan Stromberg
On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: > Dan Stromberg wrote: > >> What's the best way of converting this: >> >> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >> 14:48' >> >> ...to something easily usable in a python CGI script? > > e

Re: CGI question

2005-11-26 Thread Mike Meyer
Dan Stromberg <[EMAIL PROTECTED]> writes: > On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: >> Dan Stromberg wrote: >>> What's the best way of converting this: >>> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >>> 14:48' >>> ...to something easil

Re: CGI question

2005-11-26 Thread Dan Stromberg
On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: > Dan Stromberg wrote: > >> What's the best way of converting this: >> >> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >> 14:48' >> >> ...to something easily usable in a python CGI script? > > e

Re: CGI question

2005-11-26 Thread Fredrik Lundh
Dan Stromberg wrote: > What's the best way of converting this: > > 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 > 14:48' > > ...to something easily usable in a python CGI script? easily usable for what purpose? if you want to extract the URL that seem

CGI question

2005-11-25 Thread Dan Stromberg
What's the best way of converting this: 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 14:48' ...to something easily usable in a python CGI script? Thanks! -- http://mail.python.org/mailman/listinfo/python-list