[英]How i can start bash in a new terminal?
i want run bash in a new terminal. 我想在新的终端上运行bash。 Like this ( can be in any language)
这样(可以使用任何语言)
#create terminal ( pts for example ) #创建终端(例如pts)
pid, term = os.openpty() PID,术语= os.openpty()
# call bash shell subprocess.Popen("bash"...) #调用bash shell subprocess.Popen(“ bash” ...)
If you guys know how to create this using shell script, would be better. 如果你们知道如何使用Shell脚本创建此脚本,那就更好了。
[for shell script] [用于shell脚本]
It depends on your system, but if you are using GNU/Linux: 这取决于您的系统,但是如果您使用的是GNU / Linux:
gnome-terminal
gnome-terminal
konsole
konsole
xterm
xterm
To turn the terminal on the background, you can use &
. 要在后台打开终端,可以使用
&
。 For example gnome-terminal &
. 例如
gnome-terminal &
。
You can do this in Python using subproccess 您可以使用子过程在Python中执行此操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.