<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>afraid
not.. simple to create your own, NOTE</SPAN></FONT><FONT face=Arial
color=#0000ff size=2><SPAN class=196510321-14082008><SPAN
class=196510321-14082008> that key words can be supplied more than once.
Hence... </SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008>============================================</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>import
urllib</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>def
urldecode(query):<BR> d = {}<BR> a =
query.split('&')<BR> for s in
a:<BR> if
s.find('='):<BR> k,v =
map(urllib.unquote,
s.split('='))<BR>
try:<BR>
d[k].append(v)<BR> except
KeyError:<BR>
d[k] = [v]</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008> return d</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>s =
'Cat=1&by=down&start=1827&start=1234&anotherCat=me%3Dow%7e'<BR>print
urldecode(s)<BR>====================================================</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>prints
out following and preserves the order of inputs for those keys given more than
once as with 'start' key</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008>{'start': ['1827', '1234'], 'anotherCat': ['me=ow~'],
'by': ['down'], 'Cat': ['1']}</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=196510321-14082008>hope
that helps..</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008>Edwin</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=196510321-14082008></SPAN></FONT> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
python-list-bounces+edwin.madari=verizonwireless.com@python.org
[mailto:python-list-bounces+edwin.madari=verizonwireless.com@python.org]<B>On
Behalf Of </B>rkmr.em@gmail.com<BR><B>Sent:</B> Thursday, August 14, 2008
12:32 PM<BR><B>To:</B> python-list@python.org<BR><B>Subject:</B> urldecode
function?<BR><BR></FONT></DIV>
<DIV dir=ltr>hi<BR>is there a function that does the opposite of
urllib.urlencode? <BR><BR>for
example<BR>urldecode('Cat=1&by=down&start=1827')<BR><BR>returns a
dictionary with {'Cat':1,
'by':'down','start':1827)<BR><BR>thanks<BR></DIV></BLOCKQUOTE><pre>
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
</pre></BODY></HTML>