Answer the question
In order to leave comments, you need to log in
How to run other scripts one by one from a script and wait for their execution?
The question is in the title.
We need to make a python script that will run other python scripts and wait for the previous one to complete before starting the next one. I'm wondering how exactly to implement the required functionality?
Answer the question
In order to leave comments, you need to log in
for script in ['test1', 'test2', 'test3']:
__import__(script)
And what, exactly, is the problem? We issue in each script that we want to run, the main function, for example, which will be responsible for launching all the logic and returning something there. Then we import all these modules and run them one by one, waiting for a return from each function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question