Skip to content

Instantly share code, notes, and snippets.

@shau-lok
Created September 14, 2017 07:50
Show Gist options
  • Save shau-lok/bb93f79d0fb96c0d9e5f807cf42f5b3b to your computer and use it in GitHub Desktop.
Save shau-lok/bb93f79d0fb96c0d9e5f807cf42f5b3b to your computer and use it in GitHub Desktop.
url + params
from urllib.parse import urlencode
url = 'https://www.example.com'
params = {
'param1': 'p1',
'param2': 'p2'
}
url = f'{url}?{urlencode(params)}'
print(url)
# print ->>>>>> https://www.example.com?param1=p1&param2=p2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment