import urllib.request, urllib.parse, urllib.error
getVars = {'var1': 'some_data', 'var2': 1337}
url = 'http://domain.com/somepage/?'
print(url + urllib.parse.urlencode(getVars))
Library to build URLs in Python