import os
import fnmatch
for dirPath, dirs, files in os.walk('./'):
for file_name in files:
if fnmatch.fnmatch(file_name, '*.m'):
file_path = dirPath + '/' + file_name
with open(file_path, 'r') as f:
for line in f:
if 'ABC' in line:
print(line)