In a Unix system, within a python script, I am trying to open a terminal window and start a server. It is my understanding that python has a subprocess module that is supposed to allow such a thing. So:
import subprocess
subprocess.Popen(['path to terminal'])
returns:
OSError: [Errno 13] Permission denied
How do I run this with the right permissions? Or, is there a better, secure way to do what I need?
I’m relatively new to programming, so please reorient the discussion if my question is misguided. Thank you!
Edit: you state that you would like to execute
/Applications/Utilities/Terminal.app, so you are apparently running Mac OS X.Mac OS X .app programs are directories. They can be started with the Mac OS shell command
open.To open the program /path/to/server in a fresh Max OS Terminal session:
There’s also a shell-command version of the terminal, so you do not need
open -a.The two ways have subtle differences in how the windows are grouped by the window manager. Each time you do the above you get another terminal process and another icon in the tray. While with -a a new window is opened within the same Terminal main program.