Last active
October 14, 2019 14:14
-
-
Save cbron/c6f963ba868aaf1e948f8f65a473a32b to your computer and use it in GitHub Desktop.
URL encode/decode script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import urllib | |
import sys | |
text = sys.argv[1] | |
encoded = urllib.quote_plus(text) | |
print encoded | |
#### decode ##### | |
#!/usr/bin/python | |
from urllib import unquote | |
import sys | |
url = sys.argv[1] | |
decoded = unquote(url).decode('utf8') | |
print decoded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment