How to use to find files recursively?

There are a couple of ways: pathlib.Path().rglob() Use pathlib.Path().rglob() from the pathlib module, which was introduced in Python 3.5. from pathlib import Path for path in Path(‘src’).rglob(‘*.c’): print(path.name) glob.glob() If you don’t want to use pathlib, use glob.glob(): from glob import glob for filename in glob(‘src/**/*.c’, recursive=True): print(filename) For cases where matching files beginning with … Read more

Why is cmake file GLOB evil?

The problem is when you’re not alone working on a project. Let’s say project has developer A and B. A adds a new source file x.c. He doesn’t changes CMakeLists.txt and commits after he’s finished implementing x.c. Now B does a git pull, and since there have been no modifications to the CMakeLists.txt, CMake isn’t … Read more

tech