Tooling Tuesday – Glob: find files in a directory with #Python @biglesp

Need to find files in a directory with Python

CircuitPythoner Les writes about Glob – Unix style pathname pattern expansion…or in simpler terms, it is a library that we can use to search drives, directories for files.

Why is this useful?

Well you might be writing a script that looks for certain files and then creates backups in a remote location. You can use glob to read the directory into a list, then pause for x number of minutes before creating a list that we can compare with the first for any changes. Glob can read the files into lists ready for our use.

Les shows us how using Python and the Mu Editor. Very handy! See the full article here.