I'm trying to write a script that opens a new terminal then runs a separate python script from that terminal.
I've tried:
os.system("gnome-terminal 'python f.py'")
and
p = Popen("/usr/bin/gnome-terminal", stdin=PIPE)
p.communicate("python f.py")
but both methods only open a new terminal and do not run f.py
. How would I go about opening the terminal AND running a separate script?
Edit:
I would like to open a new terminal window because f.py
is a simply server that is running serve_forever()
. I'd like the original terminal window to stay "free" to run other commands.
p.communicate("python f.py\n")
– Ciboriumpython f.py &
then? do you need output fromp.py
? – Ciborium&
flag. I suppose this accomplishes what I'm after. – Hexone