The fnmatch
module underpinning the glob.glob()
function is not nearly sophisticated enough for your task.
Just grab all filenames and partition them after sorting:
filenames = sorted(glob.glob('sync_[0-9][0-9][0-9][0-9].tif'))
This works because your numbers are padded and can thus be sorted lexicographically. Then partition them:
s1 = [f for f in filenames if 0 < int(f[5:9]) <= 800]
s2 = [f for f in filenames if 800 < int(f[5:9]) <= 1600]
s3 = [f for f in filenames if 1600 < int(f[5:9]) <= 2400]
The directory I/O will be the slowest here anyway. You can make this all a little more efficient by looping just once and swapping what you append to:
target = s1 = []
s2 = []
s3 = []
for f in filenames:
num = int(f[5:9])
if num > 800:
target = s2
elif num > 1600:
target = s3
target.append(f)
but for a task like this sticking to the simpler list comprehensions is just fine too.