I have a Python script where I have bash commands. I would like to open a terminal (using Ubuntu) and run these commands. I know there is a lib call subprocess but I need to watch the log continuously and open another terminals to run commands.
os.system("gnome-terminal --command 'bash -c \"<command>; bash\" '")
I am using this command to open a terminal and run one command but I need to run more (like 10-20 or 50 commands). I don't want to make a large string using ; to separate the commands. Is there a way to open a terminal with a pid and send commands to it or something else to solve this problem? The most important is to run bash commands one by one in one terminal and watch the log or output during the process running.