这是我的代码:
import pexpect
import spawn
host = 'xx.xx.xx.xx'
userName = 'akshay'
password = 'xxxxxxxxxxxxxx'
**child = spawn('ssh %s@%s' %(userName, host))**
child.setwinsize(1000,200)
child.expect(['password'], timeout=5)
在这里,我尝试使用pexpect
和spawn
SSH到一个框中,但是我的Pycharm总是返回
TypeError: 'module' object is not callable in the bold line
你这样做是完全错误的,首先spawn不是一个你需要导入的模块
代码如下:
总是在中定义超时pexpect.spawn,因为您无法在其他任何地方覆盖它
相关问题 更多 >
编程相关推荐