I want to run 2 programs in Python one after the other. I use Popen but it appears they run in parallel. I have something like this:
p1 = Popen(['./program1'])
p2 = Popen(['./program2'])
How can I make p2 to start only when p1 finish?
Thank you
this should work.
p1 = Popen(['./program1'])
p1.wait()
p2 = Popen(['./program2'])
p2.wait()
it will cause the program to block until each subprocess exits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With