wexpect
Wexpect is a Windows variant of pexpect.
Pexpect is a Python module for spawning child applications and controlling them automatically.
Install
pip install wexpect
Note that only python 2.x is supported.
Usage
To interract with a child process use spawn method:
child = pexpect.spawn('C:\Windows\System32\cmd.exe')
child.expect('>')
child.sendline('ls')
child.expect('>')
For more information see examples folder.
What is it?
Wexpect is a Python module for spawning child applications and controlling them automatically. Wexpect 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. Wexpect is in the spirit of Don Libes' Expect, but Wexpect is pure Python. 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. While Wexpect works on Windows platforms. The Wexpect interface focuses on ease of use so that simple tasks are easy.
History
Wexpect is a one-file code developed at University of Washington. There are several copy and reference to this code with very few (almost none) documentation nor integration.
This repo tries to fix these limitations, with a few example code and pypi integration.
Installation and limitation of wexpect
Current version does not work on python-3.x. You need to use python 2.x to use wexpect.
Standard installation
This version is uploaded to pypi server so you can easily install with pip:
pip install wexpect
Manual installation
Because this is a tiny project dropping the wexpect.py file into your working directory is usually good enough instead of installing. However in this case you need to install manually the one dependence.
One (non stanbdard) package, pypiwin32 is needed by wexpect.
pip install pypiwin32
Metadata
Release files for wexpect 2.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wexpect-2.3.2.tar.gz | 33.4 kB | Without provenance | Details for wexpect-2.3.2.tar.gz |
Release files / wexpect-2.3.2.tar.gz
| Download URL | wexpect-2.3.2.tar.gz |
|---|---|
| Size | 33.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02d9227c3ecaa490cf93a69e93a3f4b0d2f9a9590a33dc96075a3e5049a0d2bf
|
|
BLAKE2b-256 checksum How to use checksums |
5661e3cd7d8fb12d3d4d518db1594f33b96b3a33f9478d073a005eaf0c80a5c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16
|
Security for wexpect 2.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.