import os for root, dirs, files in os.walk(os.path.join(path, 'FV/'), topdown=True): print root print files.sort(reverse=True)
This is an alternative .. (given that glob.glob() does not accept parameters for ordering elements, I just presented an alternative to glob.glob() , which is, walk() .. It accepts parameters that may be useful, and I think that downvotes are unfair, but everyone who is entitled to their opinion -.-)
source share