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-2.0.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for xpect-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d18c469062a03f240834ca407822192d7ebc0066b2dc4b9133a8e098a48f8ea6 |
|
MD5 | 58911d81494d92cdcd0119620682898e |
|
BLAKE2b-256 | 949ff2360287980e7315228cd1c5cb8ec8fb8255f775f687ef9f4f8adac2170c |