Files from directory being pulled in wrong order with python [duplicate]
os.listdir
doesn't guarantee any ordering of the contents of a directory. If you want the items to be sorted, just sort them using the builtin sorted
function (with an appropriate key
function if necessary).