12 lines
398 B
Python
12 lines
398 B
Python
import os, glob
|
|
|
|
# traverse root directory, and list directories as dirs and files as files
|
|
for root, dirs, files in os.walk("/home/steve/Code/python/initiation"):
|
|
for filename in files:
|
|
path = os.path.join(root, filename)
|
|
print(path)
|
|
|
|
|
|
# https://docs.python.org/fr/3/library/glob.html
|
|
files = glob.glob("/home/steve/Code/python/initiation/**/*.py", recursive=True)
|
|
print(files) |