How to run multiple python scripts from python/shell script in background (eq. run them immediatelly as if started from terminal), but wait for execution of the second one and restart first one, when second one ends?
Basically what I want to do (pseudocode)
start first.py
for x in range(0,10):
start second.py (args =x, x+1, ...)
wait_for_second_to_end()
restart_first_one()
I guess it can be done with threading, where I call os.system() - wait for one thread to end, then kill another one. But i want those scripts to run with as many resources as possible, they both create multiple threads. Will using threads slow it down?