Files
pyfa/gui/utils/sorter.py
2019-12-07 03:07:49 +03:00

14 lines
267 B
Python

"""
Taken from https://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python
"""
import re
def _convert(text):
return int(text) if text.isdigit() else text
def smartSort(key):
return [_convert(c) for c in re.split('([0-9]+)', key)]