1
私はマシンにtelnet接続してコマンドを実行しようとしていますが、ターミナル(実際にPythonスクリプトを実行している場所)に戻ってきます。数行のコードを実行した後、私はtel-nettedプロセスに戻り、いくつかの事柄を確認する必要があります。PythonでのTelnetの使用
私はそれを行う方法がわかりません。私は以前はTCLでspawn idを使用し、コマンドをプロセスに送ることができました。
誰かがpythonでプロセスIDを使ってtel-nettedプロセスに戻る方法を教えてもらえますか?私はtelnet_id
を印刷するとき
ip address = "127.0.0.1 8000"
username = "root"
password = "admin123"
telnet_id = pexpect.spawn("telnet " + ipaddress)
telnet_id.expect(":")
それはstandardlibraryからtelnetlibと間違っている何
exitstatus: None
flag_eof: False
pid: 17398
child_fd: 3
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <open file '<stdout>', mode 'w' at 0x7f0581d9c150>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
可能性のある重複参照[Telnetセッションのためのスクリプトの作成を?](http://stackoverflow.com/questions/709801/creating-a-script-for-a-telnet-session) – tripleee