此代码在Python中创建pty(伪终端)。我曾评论说,我不明白 import os,select
pid, master_fd =os.forkpty() #I guess this function return the next available pid and fd
args=['/bin/bash']
if pid == 0:#I have no I idea what this
我有一个关于如何发送输入和从终端子进程接收输出的问题,如ssh。在python一个例子是这样的: how to give subprocess a password and get stdout at the same time 我找不到Golang一个简单的例子,它类似于上述的工作原理。 在Golang我会想要做这样的事情,但它似乎并没有工作: cmd := exec.Command("ssh"