How to find files named with numbers in Python?
滿天的星座
滿天的星座 2017-06-28 09:23:17
0
1
836

There are the following files:
/images/1.png
/images/2.png
/images/10.png
/images/100.png
/images/a .png

How to find and traverse all files named with numbers?
for i in glob.glob(r'/images/[0-9].png'):
This can only match 1.png and 2.png.

滿天的星座
滿天的星座

reply all(1)
洪涛
result = [i for i in glob.glob('/images/[0-9]*.png') if i.split('.')[0].isdigit()]
for i in result:
    print(i)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template