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 and control it as if a human were typing commands.

Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup scripts for duplicating software package installations on different servers. It can be used for automated software testing. Pexpect is in the spirit of Don Libes' Expect, but Pexpect is pure Python.

The main features of Pexpect require the pty module in the Python standard library, which is only available on Unix-like systems. Some features—waiting for patterns from file descriptors or subprocesses—are also available on Windows.

If you want to work with the development version of the source code then please read the DEVELOPERS.rst document in the root of the source code tree.

Free, open source, and all that good stuff.

You can install Pexpect using pip:

Code Quality Rank: L3
Programming language: Python
License: ISC License

pexpect alternatives and related packages

Based on the "DevOps Tools" category

Do you think we are missing an alternative of pexpect or a related project?

Add another 'DevOps Tools' Package

pexpect Recommendations

There are no recommendations yet. Be the first to promote pexpect!

Have you used pexpect? Share your experience. Write a short recommendation and pexpect, you and your project will be promoted on Awesome Python.
Recommend pexpect

Recently added pexpect resources

Do you know of a usefull tutorial, book or news relevant to pexpect?
Be the first to add one!