urlDecode()

gert gert.cuykens at gmail.com
Fri Mar 2 00:12:45 EST 2007


On Mar 1, 1:40 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> En Wed, 28 Feb 2007 22:45:40 -0300, gert <gert.cuyk... at gmail.com> escribió:
>
> > import re
>
> > def htc(m):
> >     return chr(int(m.group(1),16))
>
> > def urldecode(url):
> >     rex=re.compile('%([0-9a-hA-H][0-9a-hA-H])',re.M)
> >     return rex.sub(htc,url)
>
> > if  __name__ == '__main__':
> >     print urldecode('adasasdasd%20asdasdasdas')
>
> > Ok thats it enough googeling around i make one my self :)
>
> You reinvented urllib.unquote
>

lol ok i am not going to argue about why they call it unquote





More information about the Python-list mailing list