Feb-12-2018, 01:30 PM
You can try this:
os.walk and glob is using os.scandir, which is not collecting the stat information, which is faster.
def find(path, ext): for root, dirs, files in os.walk(path): for file in files: if file.endswith(ext): fp = os.path.join(root, file) yield fpI guess, it takes the same time. Maybe you repeat the search twice or more. Try it more then one time.
os.walk and glob is using os.scandir, which is not collecting the stat information, which is faster.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!