sending to an xterm

Emile van Sebille emile at fenx.com
Fri Aug 8 22:55:29 CEST 2008


Kent Tenney wrote:
> Howdy,
> 
> I want to open an xterm, send it a command and have it execute it.
> 
> I thought pexpect would do this, but I've been unsuccessful.
> 
> term = pexpect.spawn('xterm')
> 
> starts an xterm, but
> 
> term.sendline('ls') 
> 
> doesn't seem to do anything.
> 
> Suggestions?
> 
> Thanks,
> Kent
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
> 

expect or http://www.noah.org/wiki/Pexpect


Emile




More information about the Python-list mailing list