デバイスへの ssh と telnet を同時に行う必要があるアプリケーションを作成しています。擬似コードは次のようになります。
p1 = pexpect.spawn("ssh to the device")
p1.send("run some command")
p1.expect("..")
p2 = pexpect.spawn("telnet to same device")
p2.send("run a command that can be run only through telnet")
p2.expect("..")
p1.send("run some other command")
p1.expect("..")
p2.send("run another command that can be run only through telnet")
p2.expect("..")`
お気付きかもしれませんが、2 つの pexpect の子プロセスを 1 つずつ実行するには、これらのプロセスを同期する必要があります。いろいろ検索しましたが、情報が見つかりませんでした。助けてください。ありがとう