tags: python web The [docs](https://docs.python.org/3/library/urllib.html)[d]. Use `urllib.parse.quote_plus(x)`. ```py import sys import urllib.parse tmpl = "https://mail.google.com/mail/u/0/#search/%s" args = sys.argv[1:] search_string = " ".join(args) search = urllib.parse.quote_plus(search_string) url = tmpl.replace("%s",search) print(url) ```