Wells Oliver wrote:
Bit of code:print sorted(results.items(), key=operator.itemgetter(1)) Would rather use 'H9', which is the name of the key in position 1 like: print sorted(results.items(), key=operator.itemgetter('H9')) Obviously that ain't work else I wouldn't be sending this email. Any tips?
Suppose namepos=['H9':1,} etc, then itemgetter(namepos['H9']) -- http://mail.python.org/mailman/listinfo/python-list