I have a list of tuples:
self.gridKeys = self.gridMap.keys() # The keys of the instance of the GridMap (It returns the product of every possible combination
This should do the trick
import operator self.gridKeys.sort(key=operator.itemgetter(1))