sort a dictionary by keys in specific order

spohle spohle at gmail.com
Fri May 26 19:26:44 CEST 2006


hi i have a normal dictionary with key and value pairs. now i wanna
sort by the keys BUT in a specific order i determine in a list !? any
ideas

dic = {'key1':'value1', 'key2':'value2', 'key3':'value3'}

list = [key2, key3, key1]




More information about the Python-list mailing list