urlDecode()

G

gert

Anybody can tell me what i need to import to make urlDecode() work in
python2.5 please.

import urllib
urllib.urlDecode(post) #doesn't exist
urllib.urldecode(post) #doesn't exist
urldecode(post) #doesn't exist
urlDecode(post) #doesn't exist
 
G

gert

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 :)
 
D

Dennis Lee Bieber

Anybody can tell me what i need to import to make urlDecode() work in
python2.5 please.
Probably the same thing you'd import for python 2.4, 2.3, etc...

IOWs, it is NOT part of the standard distribution.
import urllib
urllib.urlDecode(post) #doesn't exist
urllib.urldecode(post) #doesn't exist

http://sourceforge.net/tracker/index.php?func=detail&aid=740827&group_id=5470&atid=305470

Note the keyword: Rejected

urldecode(post) #doesn't exist
urlDecode(post) #doesn't exist

Why would they, nothing in your post shows anything that would
define them...

Explore google... You should find:

http://wiki.w4py.org/webwarenews.html
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
G

Gabriel Genellina

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
 
G

gert

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top