(names)
Sort the given list in the way that humans expect.
    Source: http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html
Sort the given list in the way that humans expect.
    Source: http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html
Sort the given list in the way that humans expect . Source : http : // www . codinghorror . com / blog / 2007 / 12 / sorting - for - humans - natural - sort - order . html
def sort_nicely(names):
    """ Sort the given list in the way that humans expect.
    Source: http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html
    """
    convert = lambda text: int(text) if text.isdigit() else text.lower()
    alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
    names.sort(key=alphanum_key)
def sort_nicely ( names ) : convert = lambda text : int ( text ) if text . isdigit ( ) else text . lower ( ) alphanum_key = lambda key : [ convert ( c ) for c in re . split ( '([0-9]+)' , key ) ] names . sort ( key = alphanum_key )