RosettaCodeData/Task/URL-decoding/Python/url-decoding.py

7 lines
166 B
Python
Raw Normal View History

2019-09-12 10:33:56 -07:00
#Python 2.X
2013-04-11 01:07:29 -07:00
import urllib
print urllib.unquote("http%3A%2F%2Ffoo%20bar%2F")
2019-09-12 10:33:56 -07:00
#Python 3.5+
from urllib.parse import unquote
print(unquote('http%3A%2F%2Ffoo%20bar%2F'))