This is fairly simple in PHP, how do I do it in Python? http://www.php.net/manual/en/function.ksort.php