Go to file
Benedek Racz af8d24df1d Introduce WEXPECT_EXECUTABLE environment variable for pyinstaller
Last versions searched wexpect executable ../wexpect/wexpect.exe in
bindled mode. This was hard coded. Now the (optional) WEXPECT_EXECUTABLE
environment variable can point to wexpect executable.

See #12 for more details.
2020-04-09 10:02:04 +02:00
.github/ISSUE_TEMPLATE Update issue templates 2019-09-09 13:18:15 +02:00
doc [DOC] update doc with default spawn class. 2020-04-08 16:02:41 +02:00
examples [FIX] add psutil to requirements; [FIX] test_buffer_interface: the assertion should have been delayed 2020-01-22 12:23:01 +01:00
issues [ADD] reproduce script for #18 2019-11-29 10:05:04 +01:00
tests [TST] Improove code coverity 2020-04-06 13:07:49 +02:00
wexpect Introduce WEXPECT_EXECUTABLE environment variable for pyinstaller 2020-04-09 10:02:04 +02:00
.gitignore [FIX] fix duplicated logging #28 2020-03-30 09:05:36 +02:00
.travis.yml [FIX] fix issue #6. Debug print remained in the write process 2019-09-19 15:26:01 +02:00
appveyor.yml [REF] using only tox matrix 2020-02-23 14:54:10 +01:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2019-09-09 13:25:20 +02:00
codecov.yml [ADD] more tests, and more deprecated warnings 2019-10-04 13:26:36 +02:00
LICENSE [ADD] License 2019-04-24 10:13:27 +02:00
README.md [DOC] update doc with default spawn class. 2020-04-08 16:02:41 +02:00
requirements.txt [FIX] add psutil to requirements; [FIX] test_buffer_interface: the assertion should have been delayed 2020-01-22 12:23:01 +01:00
setup.cfg [CLN] remove relative import from tests 2020-02-22 23:03:28 +01:00
setup.py uninstall working 2019-05-03 13:09:36 +02:00
tox.ini [TEST] add SpawnSocket tests to tox. 2020-04-05 13:30:31 +02:00
wexpect.spec [ADD] pyinstaller feature based on #12 2020-02-21 15:45:33 +01:00

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.