Skip to content

Instantly share code, notes, and snippets.

@eiri
Created March 28, 2016 15:38
Show Gist options
  • Save eiri/84875bd3e91579117f7b to your computer and use it in GitHub Desktop.
Save eiri/84875bd3e91579117f7b to your computer and use it in GitHub Desktop.
Simple python CLI url encoder

Drop it in ~/bin and use as following

vagrant@karas:~/git$ echo voluptatem%:doloribus | urlencode 
voluptatem%25%3Adoloribus
#!/usr/bin/env python
import sys, urllib as ul
[sys.stdout.write(ul.quote_plus(l.rstrip('\n')) + '\n') for l in sys.stdin]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment