python - 在不同的控制台窗口中启动进程

标签 python

如何在 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/

相关文章:

python - TypeError : unbound method __init__() . ...在重新打包后的单元测试期间

python - Python 中的平滑

python - 如果 Python 线程在获取锁后死亡,会发生什么情况?

python - WxWidgets:仅使用模态时是否需要运行 MainLoop?

javascript - 对于一段时间内未发送消息的已连接网络套接字,chrome 是否有超时?

python - 使用 numpy 从对角线值创建数组堆栈

python - 图像打开 python 速度慢,建议提高速度?

python - 在 Python 中从设备名称映射到挂载点的可靠和 "as portable as possible"方式

python - 如何在Python中增量计算罚款?

python - 如何在 pandas 的 for 循环迭代中创建多个数据帧?