Home

WinPexpect

WinPexpect is a port of pexpect to the Windows platform. Pexpect is a Python version of Don Libes' Expect library for TCL. WinPexpect runs 100% native on Windows using Mark Hammond's excellent pywin32 Python for Windows extensions (no Cygwin required!). At the moment winpexpect includes a modified copy of pexpect, but the goal is to get this merged upstream with pexpect and to stop this project as a separate project.

WinPexpect is open source software and is distributed under a MIT License.

Installation Instructions

WinPexpect supports Python 2.6 and higher (including Python 3.x). Earlier version of Python may work but are untested. Before you can install it you need to download and install the pywin32 extensions. Note that winpexpect includes a (slightly) modified version of pexpect and so you should not install pexpect yourself.

The easiest way to install winpexpect is via the Python Package Index.

  $ easy_install winpexpect

You can also download the source from the downloads section and then use setuptools to install:

  $ python setup.py install

WinPexpect includes unit tests. To run the tests, you need nose. Use the following command to run the tests:

  $ python setup.py test

Using WinPexpect

The API of winpexpect is identical to that of pexpect. The only difference is that you must use the class "winspawn" instead of "spawn". So:

from winpexpect import winspawn
child = winspawn('powershell')

Support

For support, please use the winpexpect group on Google Groups.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.