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.
pexpect モジュールを使用して、生成された/子プロセスに特定のキーの組み合わせを渡すにはどうすればよいですか? telnet を使用していて、Ctrl+Z をリモート サーバーに渡す必要があります。
TNX
sendcontrol()を使用する
例えば:
p = pexpect.spawn(your_cmd_here) p.sendcontrol('z')