python - 客户端中的exec_command和Paramiko的频道之间的区别?
问题描述
在 Python 包 Paramiko 中,和中存在exec_command
方法,它们有什么区别?channel.py
client.py
解决方案
这Channel
是一个您通常不应该使用的低级 API。
SSHClient.exec_command
调用和Channel.exec_command
之后创建stdin
//对象并将它们作为 3-touple 返回。你必须自己创建这些对象(因为没有它们是无用的)。stdout
stderr
Channel
Channel.exec_command
另请参见Paramiko exec_command failed with 'NoneType' object is not iterable。
此外,分别触发和的SSHClient.exec_command
hasget_pty
和参数。environment
Channel.get_pty()
Channel.update_environment
推荐阅读
- tfs - TFS 构建写入消息链接以报告
- python - 如何在绘图中修改网格尺寸?
- linux - 如何在linux中将字符串附加到多个文件
- javascript - 我应该如何测试 observable 是否引发错误?
- django - 为模型中的字段分配值的多字段创建 post api
- java - Java 和日期(无法解析的日期)
- websocket - HAProxy 基于 Sec-WebSocket-Protocol 重定向到后端
- apache-flink - Apache Flink RichAsyncFunction open() 是否在初始化或每个函数调用时被调用一次?
- rust - rust 中引用与值的显式注释
- prolog - Internal workings of ic_global/occurrences/3