tags:

views:

102

answers:

1

How do I pass a certain key combination to a spawned/child process using the pexpect module? I'm using telnet and have to pass Ctrl+Z to a remote server.

Tnx

+4  A: 

use sendcontrol()

for example:

p = pexpect.spawn(your_cmd_here)
p.sendcontrol('z')
Jweede