ISDIGIT PYTHON
txt = "50800"
x = txt.isdigit()
print(x)
Homely Hamerkop
txt = "50800"
x = txt.isdigit()
print(x)
from natsort import natsorted
my_list = ['image101.jpg', 'image2.jpg', 'image1.jpg']
natsorted(my_list)
>>> my_list= ['image101.jpg', 'image2.jpg', 'image1.jpg']
>>> my_list.sort(key=lambda x: int(''.join(filter(str.isdigit, x))))
>>> my_list
['image1.jpg', 'image2.jpg', 'image101.jpg']