Added Nice Sorting Functionality using RE

Yeah
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2023-06-26 19:33:07 +00:00
parent 06afb118d7
commit d30a1dcb62

View file

@ -1,6 +1,7 @@
# THIS FILE IS A PART OF VCStudio
# PYTHON 3
import re
# This is collection of simple geometric math operations that I gonna use trough
# out the UI of the VCStudio. Stuff like collision detections, overlap detections
@ -161,3 +162,15 @@ def timestring(tleft):
def tryint(s):
try:
return int(s)
except:
return s
def alphanum_key(s):
return [ tryint(c) for c in re.split('([0-9]+)', s) ]
def sort_nicely(l):
l.sort(key=alphanum_key)