I'm using the following code to run multiple .py files at once. The files are all very specific and prone to change very often. So it's easier for me to individualise them so I can change them whenever I need to.
calculate=(
'indicator1.py',
'indicator2.py',
'indicator3.py',
'indicator4.py',
'indicator5.py',
'indicator6.py',
'indicator7.py')
for file in calculate:
exec(open(file,'rb').read())
The problem arises when I get an error. I have no way to immediately know which file has the problem.
How can I add some lines of code that return the specific file from calculate where the error was found? If possible, also in which line of that specific file.
Thank you so much!