我试图结合stdout和stderr的输出.我相信这可以通过Channel对象的set_combine_stderr()完成.
这就是我在做的事情:
SSH = paramiko.SSHClient()
#I connect and everything OK, then:
chan = ssh.invoke_shell()
chan.set_combine_stderr(True)
chan.exec_command('python2.6 subir.py')
resultado = chan.makefile('rb', -1.)
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试存储结果时,我收到以下错误(上一行,chan.makefile()):
错误:频道已关闭.
任何帮助将不胜感激