Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python中从pxssh进程获取标准输出_Python - Fatal编程技术网

如何在Python中从pxssh进程获取标准输出

如何在Python中从pxssh进程获取标准输出,python,Python,我用Python编写了这段代码,在远程服务器上运行该程序: import pxssh w=pxssh.pxssh() w.login(blade11,'root','') w.sendline('cd /home/*/incoming/') w.prompt() w.sendline('./program') w.prompt() 当我通过Putty运行同一个程序时,我会得到“./program”的执行输出 当通过python脚本运行程序时,如何获得相同的输出

我用Python编写了这段代码,在远程服务器上运行该程序:

import pxssh
w=pxssh.pxssh()
w.login(blade11,'root','')
w.sendline('cd /home/*/incoming/')
w.prompt()
w.sendline('./program')
w.prompt()
当我通过Putty运行同一个程序时,我会得到“./program”的执行输出 当通过python脚本运行程序时,如何获得相同的输出