我基本上想连接到我的模拟器从那里执行几个命令。 在unixshell中,我通过发出命令“gmake CONFD\u NUMBER=1nthconfdcli”从unixshell连接到模拟器,但是当我运行下面的脚本时,我的代码挂起。你知道吗
def Simulator():
command = "gmake CONFD_NUMBER=50 nthconfdcli"
p = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE)
(output, err) = p.communicate()
p.expect("#")
p.sendline('show test cli');
p.expect (['#',pexpect.EOF])
show = p.before
print show
p.sendline('exit');
目前没有回答
相关问题 更多 >
编程相关推荐