helm/bin/urlencode
2017-04-25 02:58:25 -04:00

13 lines
264 B
Python
Executable file

#!/usr/bin/env python
import sys
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
if sys.argv[1:]:
text = " ".join(sys.argv[1:])
else:
text = "".join(sys.stdin.readlines())
print(quote_plus(text.strip()))