I am using the following two lines of Python code to open a new Terminal window from a Python script, and this works fine:
import os
os.system('open -a Terminal .')
Now I would like to pass the new Terminal window a command to be executed, for example
ls
How can I do that?
bash -c "ls; exec bash"
. I'm not familiar with OS X, but in most Linux terminal emulators you can pass it in a flag. – Kenwood