Hi,<br>
<br>
I need to perform some horrible functions in python I need to do, using sort in a similar way that Excel can.<br>
<br>
With a dictionary like:<br>

<div class="smallfont" style="margin-bottom: 2px;">Code: ( text )</div>
<div class="text" style="margin: 0px; padding: 2px; background: rgb(252, 252, 252) none repeat scroll 0% 50%; color: rgb(34, 34, 34); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<ol><li style="background: rgb(252, 252, 252) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 8pt;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
>>> d</div></li><li style="background: rgb(252, 252, 252) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 8pt;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">{8: (99, 99), 9: [(55, 67), (77, 66), (67, 88)], 4: [(45, 78), (56, 78), (99, 78)], 5: (67, 77)}</div></li></ol></div>
<br>
I want to sort the entire dictionary based on the last values in each line. First for [-1][0] and then[-1][0].<br>
<br>
So sorted descending I would like the output to look like:<br>

<div class="smallfont" style="margin-bottom: 2px;">Code: ( text )</div>
<div class="text" style="margin: 0px; padding: 2px; background: rgb(252, 252, 252) none repeat scroll 0% 50%; color: rgb(34, 34, 34); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<ol><li style="background: rgb(252, 252, 252) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 8pt;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
>>> d</div></li><li style="background: rgb(252, 252, 252) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 8pt;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">{8: (99, 99), 4: [(45, 78), (56, 78), (99, 78)], 9: [(55, 67), (77, 66), (67, 88)], 5: (67, 77)}</div></li></ol></div>
<br>
Many thanks