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 pyserial
>>> import expect
>>> serial_linux = pyserial.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-1.5.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70df472203c101bb05936cf53ef421d4d5fdd0b9b95fb3819816c5c251ad73c9 |
|
MD5 | d11a3f7f1f5ff37085779d7949a50833 |
|
BLAKE2b-256 | d61f9c0aae232d86205a83dd049885e7198c6c06eb47daa416c358f090b37d2d |