Pexpect 2.0 review

Download
by rbytes.net on

Pexpect is a Python Expect-like module

License: Python License
File size: 0K
Developer: noahspurrier
0 stars award from rbytes.net

Pexpect is a Python Expect-like module. Pexpect project spawns child applications, controls them, and responds to expected patterns in their output. It can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc.

It can be used to automate setup scripts for duplicating software package installations on different servers. It can be used for automated software testing. It should work on any platform that supports the standard Python pty module.

Its interface was designed to be easy-to-use, so performing simple tasks is easy. It includes an ANSI/VT100 terminal screen scraping module.

Requirements:
Python

Pexpect was written and tested with Python 2.1. It should work on earlier versions that have the pty module. I sometimes even manually test it with Python 1.5.2, but I can't easily run the PyUnit test framework against Python 1.5.2, so I have less confidence in Pexpect on Python 1.5.2.

pty module

Any POSIX system (UNIX) with a working pty module should be able to run Pexpect. The pty module is part of the Standard Python Library, so if you are running on a POSIX system you should have it. The pty module does not run as well on all platforms. I have taken effort to try to smooth the wrinkles out the different platforms. To learn more about the wrinkles see Bugs and Testing.

Pexpect does not currently work on the standard Windows Python(see the pty requirement); however, it seems to work fine using Cygwin. It is possible to build something like a pty for Windows, but it would have to use a different technique that I am still investigating. I know it's possible because Libes' Expect was ported to Windows. If you have any ideas or skills to contribute in this area then I would really appreciate some tips on how to approach this problem.

What's New in This Release:
This release adds a new run() function which wraps the spawn() class and can handle most of the tasks for which spawn() was used (it's like a super os.system() function), a new pxssh class which specializes spawn to handle SSH connections, buffering, and improved speed.

Pexpect 2.0 search tags