How to add files into a list by order
In my directory i have the following files: slide1.xml, slide2.xml, slide3.xml ... slide13.xml
os.listdir(path)
doesn't return me a list by order
I've tried this way
files_list = [x for x in sorted(os.listdir(path+"/slides/")) if os.path.isfile(path+"/slides/"+x)]
output: ['slide1.xml', 'slide10.xml', 'slide11.xml', 'slide12.xml', 'slide13.xml', 'slide2.xml', 'slide3.xml', 'slide3_COPY.xml', 'slide4.xml', 'slide5.xml', 'slide6.xml', 'slide7.xml', 'slide8.xml', 'slide9.xml']