+bin/urlencode

This commit is contained in:
Henrik Lissner 2016-11-15 14:08:57 +01:00
parent 0651c6e3a4
commit c9f13d2eca

7
bin/urlencode Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env python
import os, sys, urllib
if os.isatty(file.fileno(sys.stdin)):
text = sys.argv[1]
else:
text = "".join(sys.stdin.readlines())
print(urllib.quote_plus(text.strip()))