I have a mainPath
to indicate the path to do function listdir()
. I want to get the name of the files inside the mainPath
. So I tried this:
import os
os.listdir(mainPath)
And I get the following result
However, I would like that the list of paths will be ordered based on the number of each filename. Something like ['01. Enero','02. Febrero', '03. Marzo', ..., '09. Setiembre']
. So, how this could be done?