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.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce49b4d1057d613da6a7d89547017e5e2ceb2624e1bd6240591d323eb75ae3f5 |
|
MD5 | 27fa7a6fc64c779836369ad555831775 |
|
BLAKE2b-256 | 19088ed63f71adad5753bbf3d42004af83ab80878caefb1fc582ab277d351eaf |