Reputation: 21
On Windows, the python subprocess command to open a cmd window is simply:
import subprocess
subprocess.Popen('cmd.exe')
Can anyone tell me what the command to open the cmd equivalent in Linux is? I'm going to be copying some python code from my Windows machine to my Raspberry Pi and am new to Linux - I know that this line of code won't open the terminal on a Linux OS the same way it will on Windows.
Thanks in advance!
Upvotes: 2
Views: 3261
Reputation: 77347
Different distros use different terminal programs. xterm
should work on just about everything, so you could Popen('xterm')
and then require the people figure out how to get xterm on their system if its not there by default.
Upvotes: 1
Reputation: 1651
Replace cmd.exe
with gnome-terminal
in order to open a terminal on Linux
Upvotes: 5