I have three .py files that I want to run simultaneously in a Python script file. I initially called subprocess.call() three times (once for each .py file), but remembered that it was blocked until the command was completed. I tried subprocess.Popen(['screen', 'python_file']) , since I believe that it does not block, but when I checked processes with screen -ls , only one process was running. How to make all three programs work simultaneously with a Python script? Should I use the multiprocessing or multithreading library?
Edit: other processes should not end, as they work in an infinite loop. Here is exactly what I had in the Python script file. I use screen because every .py file has a stdout registered on the terminal and I want to be able to see what is logged for each.
subprocess.Popen(['screen', './submitter.py'])
subprocess.Popen(['screen', './worker.py'])
subprocess.Popen(['screen', './tester.py'])
source share