I am scanning a directory for new python scripts.
I expect each script file to have an arbitrary function report()
.
Say, the following files were found in my directory: ['file1.py', 'file2.py']
.
So "file1.py" should contain:
def report():
print('I am just a script.')
I need to call report()
function for each one of them.
How to do it?