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.1.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dcd8054243bda954a14efbed3ec1e40eb8b035fb90fdb21addac7b2cb081168 |
|
MD5 | c708cb74ddb303654944c6410648a122 |
|
BLAKE2b-256 | a6d8408453543b6614718c6fb066a45c8d3cb4a60162e170bdadc99f2ad534b8 |