- Pexpect is a Pure Python Expect-like module. Pexpect makes Python a better tool for controlling other applications. Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. Pexpect works like Don Libes' Expect. Pexpect allows your script to spawn a child application.
- 'Pexpect is a Python module for spawning child applications and controlling: them automatically. Pexpect can be used for automating interactive applications.
- There are actually two windows versions to pexpect - both are not (well) maintained or developed anymore - winpexpect and wexpect. Neither of them worked for me (win 10, python 3.7.3). Nor did the latest version of pexpect, which claims to have minor support for windows. – DarkLight Sep 16 at 12:01.
Other Expect-like modules for Python require TCL and Expect or require C extensions to be compiled. Wexpect does not use C, Expect, or TCL extensions. Original Pexpect should work on any platform that supports the standard Python pty module. Download blur pc torrent. While Wexpect works on Windows platforms.
I've just been looking at what winpexpect and wexpect do to set up processes with a console, and it's pretty hairy. Searching on github and nullege, I suspect that most of the processes people want to communicate with can be dealt with using straightforward stdin/stdout pipes, as created by subprocess; though at least Powershell is an exception to that - starting it using subprocess makes very odd things happen.
Python Pexpect For Windows Download
I realise that pexpect is really conflating two separate-ish concerns: starting and controlling processes in a pseudoterminal, and waiting for specific patterns to appear in a pipe, which is often used to programmatically interact with some kind of prompt-based interface. Those features are often useful together, but they're technically quite separate, and the pattern-waiting can certainly be useful on Windows without the pty-control mechanisms. There are also cases, like terminado, which I'm working on for IPython, where we want the pty-control without the pattern-waiting.
So, my new plan is:
Pella 250 Series U Factor
- Separate out a
ptysubprocess
module which can be released on its own. Not being bound by backwards compatibility, this can expose a cleaner API, probably roughly inspired by the standard library'ssubprocess
module. This will be Unix-only. - The code in Pexpect will focus on the pattern-waiting; it will depend on
ptysubprocess
on Unix, for backwards compatibility, exposing as much of its existing API as practical, and, for the time being, it will use subprocess.Popen to control processes on Windows. But the API should be sufficiently general that you could plug in a Windows analogue of ptysubprocess to communicate with a process in a Console.