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.3.1.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c92d2abb4543d3ae725eb935e38af0d61d64d3b08c3e0e0cc191bfe79f02257 |
|
MD5 | b723aaf80917b3a883fd4f93c3468700 |
|
BLAKE2b-256 | 33c2e2968fce2a98e11f3659582a84c5ece6f18fc6fd7ba9feadd0a11d0e759a |