First off, I\'m posting this because when I was looking for a solution to the problem below, I could not find one on stackoverflow. So, I\'m hoping to add a little bit to t
@April provided a good solution in How is Pythons glob.glob ordered? that you could try
#First, get the files:
import glob
import re
files = glob.glob1(img_folder,'*'+output_image_format)
# Sort files according to the digits included in the filename
files = sorted(files, key=lambda x:float(re.findall("(\d+)",x)[0]))