N
N
Nikolai Gavrilovich2018-04-19 10:11:12
Python
Nikolai Gavrilovich, 2018-04-19 10:11:12

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

2 answer(s)
S
Sergey Gornostaev, 2018-04-19
@nikgavrilovich

for script in ['test1', 'test2', 'test3']:
    __import__(script)

I
iSergios, 2018-04-19
@iSergios

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 question

Ask a Question

731 491 924 answers to any question