List duplicate data concatenation in python
This is in continuation of list issue but here I want to preserve the order of the dict
listData=[('audioVerify', '091;0'), ('imageVerify', 'icon091.gif'), ('bufferVerify', '\x01?')]
methodList = {}
for item in listData:
methodList.setdefault(item[0],[]).append(item[1:])
for method in methodList:
arguments = methodList[method]
s = [method,arguments]
print s
when I iterate the list it gives the following
['audioVerify', [('091;0',)]]
['bufferVerify', [('\x01?',)]]
['imageVerify', [('icon091.gif',)]]
but what are the possibilities where I can preserve the order as below:
['audioVerify', [('091;0',)]]
['imageVerify', [('icon091.gif',)]]
['bufferVerify', [('\x01?',)]]