Skip to content

Instantly share code, notes, and snippets.

@NotTheEconomist
Created June 2, 2015 21:59
Show Gist options
  • Save NotTheEconomist/f7a3c8a5d8837f12faba to your computer and use it in GitHub Desktop.
Save NotTheEconomist/f7a3c8a5d8837f12faba to your computer and use it in GitHub Desktop.
# assuming you've already populated d as
# d = {"pdf": ... } or whatever
from operator import itemgetter
print("Extension | Count")
for key,val in sorted(d.items(), key=itemgetter(1), reverse=True):
print("{:>9} | {}".format(key, val))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment