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('username: ')
>>> linux.send('root')
>>> linux.expect('password: ')
>>> linux.send('root')
>>> linux.expect('/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.2.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a87a7b47f4693558ace71fe3ebfb64795a700fba6440f1855d9c23f729fe2ca |
|
MD5 | 093148f5af98e7c56e5f205a803e8aba |
|
BLAKE2b-256 | e2f089478310ac5b6d5d479612d523a7cdfbcc23b42c49a5d44323b21dc56588 |