Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 paramiko 运行命令并在出现模式时退出。现在我使用pexpect.expect(..., pattern = [pattern1, pattern2,...])
pexpect.expect(..., pattern = [pattern1, pattern2,...])
有没有办法使用 paramiko?
不,我不认为 paramiko 有这种能力。以我的经验,最好的方法是将 pexpect 脚本发送到远程并用你的 paramiko 在那里执行它。Fabric 用户有时会遇到此问题:https ://stackoverflow.com/a/10007635/708221