Programmed dialogue with interactive streams.
Project description
Installation
pip install xpect
Example usage
See the test suite: https://github.com/eerimoq/expect/blob/master/tests/test_expect.py
A basic login example using pyserial:
>>> import serial
>>> import expect
>>> serial_linux = serial.Serial("/dev/ttyS0")
>>> linux = expect.Handler(serial_linux)
>>> linux.send("")
>>> linux.expect(r"username: ")
>>> linux.send("root")
>>> linux.expect(r"password: ")
>>> linux.send("root")
>>> linux.expect(r"/home/root $ ")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xpect-3.1.0.tar.gz
(11.7 kB
view hashes)
Built Distribution
Close
Hashes for xpect-3.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cbf7398786f94b6a8dfaa900ef1e073a25a1151f6863413c14a3b31b22a98d6 |
|
MD5 | e05ac50fe5d5f837715dde20aea8bea0 |
|
BLAKE2b-256 | c3d85f9081b4686453888d974f4f7b56576bbc267c43576bc59c6dc02b36ada0 |