decode a url

Andreas Kuntzagk andreas.kuntzagk at
Tue Aug 19 10:25:02 CEST 2003

On Tue, 19 Aug 2003 09:37:20 +0200, Invalid User wrote:

> Is there a function/module to decode url's in python? So far, I have come
> across "urllib.encode" for encoding, which the opposite of I am looking
> for.
Quick search on google:
which proposes cgi.parse_qsl
>>> import cgi
>>> import urllib
>>> cgi.parse_qsl(urllib.urlencode({"test1":1,"test2":3}))
[('test1', '1'), ('test2', '3')]
>>> dict(_)
{'test1': '1', 'test2': '3'}

So seems to work


More information about the Python-list mailing list