473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

urlDecode()

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

Mar 1 '07 #1
3 26230
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 :)

Mar 1 '07 #2
En Wed, 28 Feb 2007 22:45:40 -0300, gert <ge**********@gmail.comescribió:
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

--
Gabriel Genellina

Mar 1 '07 #3
On Mar 1, 1:40 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.arwrote:
En Wed, 28 Feb 2007 22:45:40 -0300, gert <gert.cuyk...@gmail.comescribió:
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
Mar 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thomas Henz | last post by:
Hi again, can anyone tell me why it says that the object doesnt support this method? rs is a db query resultset. msg is a db field with urlencoded data in it. ------------ if not rs.eof then...
0
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Win32 Visual C++ (.NET) project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace...
1
by: João Santa Bárbara | last post by:
hi all is there any replace for the System.Web.HttpUtility.UrlDecode to windows forms ... thks JSB
5
by: Yifan | last post by:
Hi I want to use UrlDecode() in C++. I have a Visual C++ (.NET) Win32 project #using <mscorlib.dll #using <System.dll #using <System.Web.dll using namespace System using namespace...
4
by: John Hoge | last post by:
Hi, I need to UrlDecode a string in a simple console application, but I am having trouble accessing Server.UrlDecode, even though System.Web is included. The application pulls a text out of a...
6
by: John Grandy | last post by:
Does Server.URLDecode() need to be applied to Request.QueryString(<key name>) ?
10
by: Alex | last post by:
Hi, I UrlEncode a value that I put in my querystring. This value originally contains the character "è", which is UrlEncoded to "%E8". When I try to read the value from the querystring, I find...
1
by: fjm67 | last post by:
I see Google edited my email address. Lets try this. captonline at yahoo dot com Can you guys help me out please? I need to implement urldecode into a php script and don't know how. Here is...
20
by: gert | last post by:
This based on a example i found at http://www.cs.tut.fi/~jkorpela/ forms/cgic.html #include <fcgi_stdio.h> #include <stdlib.h> int urldecode(char *src, char *last, char *dest){ int code;...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.