我有一个python字典,如下所示:
DictValue = {
'Event1': {},
'Event2': {
'copy3': {
'SourcePath': 'souce3',
'DestPath': 'dest3',
'Platform': u 'Debug|Win32'
},
'copy2': {
'SourcePath': 'souce3',
'DestPath': 'dest2',
'Platform': u 'Debug|Win32'
},
'copy1': {
'SourcePath': 'souce1',
'DestPath': 'dest1',
'Platform': u 'Debug|x64'
},
'copy5': {
'SourcePath': 'souce5',
'DestPath': 'dest5',
'Platform': u 'Release|Win32'
},
'copy4': {
'SourcePath': 'souce4',
'DestPath': 'dest4',
'Platform': u 'Release|x64'
}
}
}
我想对字典值进行排序,使其看起来像
^{pr2}$有可能吗?请帮忙。我正在使用python 2.6
谢谢。在
字典没有任何顺序。如果您需要订购,您可以选择:
.keys()
排序(或.values()
或{相关问题 更多 >
编程相关推荐