Skip to content

Instantly share code, notes, and snippets.

@alixaprodev
Created April 20, 2022 09:15
Show Gist options
  • Save alixaprodev/c84c9c999b9970d663bb41b148782d70 to your computer and use it in GitHub Desktop.
Save alixaprodev/c84c9c999b9970d663bb41b148782d70 to your computer and use it in GitHub Desktop.
search for all .py files inside a directory. It will find all python files available in subdirectores. It will search recursively. we have used glob module.
# author AlixaProDev
import glob
# path of the current directory
path = './'
curfiles = glob.glob(path + '**/*.py',recursive=True)
for file in curfiles:
print(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment