I have a Flask application that runs python functions that isn\'t working properly. I have identified the source of the problem to be a for loop within a function, but I don\'t
I have solved this myself. The problem lies in the function "searchXML", which is called in the for loop. The function utilizes the line
os.chdir('/Users/dinakarguthy/Documents/audit_sample')
but the line that opens the file is simply
f = open('output.html', 'w')
I open the file with a relative pathname, instead of an absolute, which is the problem. After the for loop is run my directory is changed to a different one, and so a different output.html file is created/edited in that otehr directory. However, my function still opens up a tab with the 'output.html' that is still in the original directory.