Otherwise they come out in random (inode?) order.
Also chmod +x the generator, and re-run it. Somehow on Marek's machine it produced \r\n line endings?! Open all files with newline='\n' so that (if the Python3 docs are correct) that won't happen again.
Doesn't that work? Glob returns a list (so an iterable, nope?).