Python Forum
multiprocessing - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: multiprocessing (/thread-31094.html)



multiprocessing - venividivici - Nov-22-2020

hi guys,

I'm new 2 python, im glad to see what is possible with Python! Also it is really easy to learn.

ok my question.
I am programming kind of a service to maintain a few terminal commands i do now manually in the terminal in ubuntu. I know the existenceof Python os, multiprocess, subprocces and Popen. but it is a lot investigation and code attempts to see which one will fit the best. Maybe I did not found another solution yet.

the problem is:
I want one script to maintain different terminal commands at the same time, get their output (if possible, realtime) and processing their exit/error-codes. also I want my script to continue and not wait for every command to finish first before continue. also I want to communicate between these processes before i launch a new command when another is finished while another is still running. And my script doesn't freeze it is okay but not needed if it launches multiple windows. I just want to know the exit/error codes.

is Popen the best solution for this?

edit: Yes it is.