popen and two-way communication

cmkl cmkleffner at gmx.de
Wed Oct 20 03:08:56 EDT 2004


Expect-like functionality is not supported with subprocess.py 
says the PEP. However, Cygwin Python is supported by pexpect AFAIK. 
See http://pexpect.sourceforge.net/

Regards 

Carl

Jeff Shannon <jeff at ccvcorp.com> wrote in message news:<10nbdakhv1indf2 at corp.supernews.com>...
> 
> Admittedly, I haven't tested subprocess.  But interacting with SSH or 
> gpg or most other password-requesting programs doesn't work properly 
> through pipes.  These programs read directly from the controlling TTY, 
> rather than from stdin.  Pipes don't affect the controlling TTY, meaning 
> that you'll *still* be prompted for the password. 
> 
> In short, some version of (or replacement for) Expect is probably still 
> needed.  It is indeed too bad that pexpect won't work on Windows, or 
> more accurately that the pty which pexpect relies on doesn't work on 
> Windows...  (Fortunately for me, I need to run ssh on Linux, so pexpect 
> should serve my purposes just fine.)
> 
> Jeff Shannon
> Technician/Programmer
> Credit International



More information about the Python-list mailing list