In python3, it is slightly different:
from urllib.parse import urlencode urlencode({'pram1': 'foo', 'param2': 'bar'})
output: 'pram1=foo¶m2=bar'
for compatibility with python2 and python3, try the following:
try: #python2 from urllib import urlencode except ImportError: #python3 from urllib.parse import urlencode
Johnny Zhao Jan 29 '16 at 4:13 2016-01-29 04:13
source share