import sys import os mode = "-S" state = "-R" command="--command=python test.py" +mode +state subprocess.Popen(args=["gnome-terminal", command])