Url Encode Url Decode
More Tools
Other tools: Base64 Decode | Base64 Image Decoder | Base64 Encode | Base64 Image Encoder

Python urlencode()

urlencode - Convert a mapping object or a sequence of two-element tuples to a percent-encoded string.


urllib.urlencode( query [, doseq ] )


query - When a sequence of two-element tuples is used as the query argument, the first element of each tuple is a key and the second is a value.
doseq - If set to true, individual key=value pairs separated by '&' are generated for each element of the value sequence for the key.

Return value

Returns a url encoded string

>>> import urllib
>>> params = urllib.urlencode( {'param': 'url encode'} )
>>> print "http://example.com/?" + params