subprocess.Popen in different console

前端 未结 3 776
轮回少年
轮回少年 2020-12-01 10:19

I hope this is not a duplicate.

I\'m trying to use subprocess.Popen() to open a script in a separate console. I\'ve tried setting the shell=True

3条回答
  •  不思量自难忘°
    2020-12-01 11:07

    On Linux shell=True will do the trick:

    command = 'python someFile.py' subprocess.Popen('xterm -hold -e "%s"' % command)

    Doesn't work with gnome-terminal as described here:

    https://bbs.archlinux.org/viewtopic.php?id=180103

提交回复
热议问题