I am trying to get a list of files in a directory which match a certain name e.g in Bash the Code would be :
BASH
FOLDER="MainProject"
FILES=`find "$FOLDER" -name "Localizations*swift"`
Python
import os
def read_files():
path = 'MainProject/'
folders = []
for r, d, f in os.walk(path):
for folder in d:
folders.append(os.path.join(r, folder))
for f in folders:
print(f)
Please note I am new to python hence I am struggling with this.