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-1.5.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.5.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1067ddaba340e77e505ccbba1d8341d838fe88b40dc5199703bfca67834f63ec |
|
MD5 | 2146358b4e0a865a2df6785cc30eb761 |
|
BLAKE2b-256 | 5bf13852953f2186e1ab14ec0fd2c1dc8448f61beef522c162a4b6b9d56afe83 |