I am new to python and I have trouble accessing the math text-files within the subfolders.

This is the code I have written so far:
import os, sys
for folder, sub_folders, files in os.walk(my_directory):
for special_file in files:
if special_file == 'math.txt'
file_path = os.path.join(folder, special_file)
with open(file_path, 'r+') as read_file
counter += 1
print('Reading math txt file' + str(counter))
for line in read_file:
print(line)
I am not able to do print lines of all the math.txt files within all the classes and all the schools and all the zones.
Before I had a version of the script that merged all the files, but some of the log files were extremely large (combined > 16GB).
This seems to work for me. Only changes were those that @jdi, @MRAB and I were indicating – missing colons and initializing the
countervariable. Since you’re on Windows, you may want to make sure that you’re properly specifying your directory path.