Skip to main content

Windows alternative of pexpect

Project description

wexpect

Build status codecov Documentation Status

Wexpect is a Windows variant of pexpect.

Pexpect is a Python module for spawning child applications and controlling them automatically.

You need wexpect if...

  • you want to control any windows console application from python script.
  • you want to write test-automation script for a windows console application.
  • you want to automate your job by controlling multiple application parallel, synchoronusly.

Install

pip install wexpect

Usage

To interract with a child process use spawn method:

import wexpect
child = wexpect.spawn('cmd.exe')
child.expect('>')
child.sendline('ls')
child.expect('>')
print(child.before)
child.sendline('exit')

For more information see examples folder.


REFACTOR

Refactor has been finished!!! The default spawn class is SpawnPipe from now. For more information read history.


What is wexpect?

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.


Dev

Thanks for any contributing!

Test

To run test, enter into the folder of the wexpect's repo then:

python -m unittest

Deploy

The deployment itself is automated and done by appveyor. See after_test section in appveyor.yml for more details.

The wexpect uses pbr for managing releasing procedures. The versioning is handled by the pbr. The "master-version" is the git tag. Pbr derives the package version from the git tags.

Release history Release notifications | RSS feed

This version

4.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wexpect-4.0.0.tar.gz (78.1 kB view details)

Uploaded Source

File details

Details for the file wexpect-4.0.0.tar.gz.

File metadata

  • Download URL: wexpect-4.0.0.tar.gz
  • Upload date:
  • Size: 78.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for wexpect-4.0.0.tar.gz
Algorithm Hash digest
SHA256 de9e739e78ec4d74a39bf8499904dacb6c594007a674fb7e10752c9b131f6522
MD5 5ec453cd7a2f1147bd13e4f3f5a510b0
BLAKE2b-256 da782a8ca6478f26593e036eef5462afd9f0fb0d3c209ecc448244875b6f5119

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page