I am trying to get the output into a file rather than printing to the console using python, but so far the only thing that works is typing the following into the console python myPythonFile.py > outputTest.txt
Here is the code I have:
import os
srcPath = ('path/to/my/files')
for folder, dirs, files in os.walk(srcPath):
for file in files:
fullpath = os.path.join(folder, file)
with open(fullpath, 'r') as f:
for line in f:
if "something" or "something else" or not "missingSomething" in line:
print(fullpath)
break