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.4.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.4.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2418787ad39c0ff666249f34e01853057579fa220facd7031f923c16dc770024 |
|
MD5 | c72729b2e35dda435f4f76a26eaba4d1 |
|
BLAKE2b-256 | 819892eeba39407884d9da689982b3c96ef1bf862f7f95ed3eefe32747692e4b |