Skip to content

Instantly share code, notes, and snippets.

@atrakic
Forked from cbron/urlencode
Created October 14, 2019 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atrakic/7cc6e9b46b3a6f0d8a8be0475a7e54ef to your computer and use it in GitHub Desktop.
Save atrakic/7cc6e9b46b3a6f0d8a8be0475a7e54ef to your computer and use it in GitHub Desktop.
URL encode/decode script
#!/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