Skip to content

Instantly share code, notes, and snippets.

@matiasherranz-santex
Created January 8, 2014 20:20
def custom_cmp(item1, item2):
""" Helper function to use as 'cmp' parameter when sorting the list of
.png pages in the unzipped pages images list.
"""
n1 = item1.split('.')[0][4:]
n2 = item2.split('.')[0][4:]
return int(n1) - int(n2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment