KiBot/KiBOM/sort.py

3 lines
167 B
Python

#'better' sorting function which sorts by NUMERICAL value not ASCII
def natural_sort(string):
return [int(s) if s.isdigit() else s for s in re.split(r'(\d+)',string)]