如何在 Linux 中使用 Python 启动一个进程在不同的控制台窗口中运行,与 Windows 中的类似(使用 start):
import os
os.system('start dir c:\*.* /s')
最佳答案
xterm -e 应该可以帮到你。
-e program [ arguments ... ]
This option specifies the program (and its command line arguments) to be run in the xterm window. It also sets the window title and icon name to be the basename of the program being executed if neither -T nor -n are given on the command line. This must be the last option on the command line.
例如
import os
os.system("xterm -e 'your command'")
关于python - 在不同的控制台窗口中启动进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5476239/