I want to write a Python script which will start a GUI program (as in, run a binary program with subprocess.run
or os.system
or something). The script should not block until the program is done, it should start it and then keep running.
I'm doing this on Ubuntu.
I tried subprocess.Popen
, but if I run, say subprocess.Popen("gedit")
, I get strange behavior. If I open the Ubuntu system monitor (process manager), I can see that the gedit process appears when I run the script, and the gedit window itself opens. But if I close the window, the process doesn't end in the system monitor. The process stays there until my python script exits.
How can I get the behavior I want? The only thing I can think of right now is to just call subprocess.run
in a different Python thread, is that the only thing I can do?