confusing python urlencode order -
OK, so
"Parameter Tuples in sequence sequence of parameters in encoded string."
when I try to run this code:
import urllib values = {'one': 'one', 'two': 'two' , 'Three': 'three', 'four': 'four', 'five': 'five', 'six': 'six', 'seven': 'seven' 'data = urllib.urlencode value) Output as
seven = seven and six = six and three = three and two = two and four = four & Five = five and one = one
7,6,3,2,4,5,1?
It does not look like the order of my Tuples.
Due to the implementation of the dictionaries, it has been naturally unmodified. If you want to order them, you should use the list of tuples instead (or list of tuples, or tuples, or lists of lists ...):
value = [('One', 'one'), ('two', 'two') ...]
Comments
Post a Comment