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:
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
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
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
> 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
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
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
See urlparse:
http://www.python.org/doc/current/lib/module-urlparse.html
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
13 matches
Mail list logo