Skip to content

Instantly share code, notes, and snippets.

@parkjinwoo
Created May 24, 2016 12:21
Show Gist options
  • Save parkjinwoo/9d1db0f5edf5114ef2648020384e874c to your computer and use it in GitHub Desktop.
Save parkjinwoo/9d1db0f5edf5114ef2648020384e874c to your computer and use it in GitHub Desktop.
urllib
# urlencode
python2 -c "import urllib, sys; print urllib.quote(sys.stdin.read())"
python3 -c "import sys; from urllib.parse import quote; print(quote(sys.stdin.read()))"
# urldecode
python2 -c "import urllib, sys; print urllib.unquote(sys.stdin.read())"
python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment