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.3.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for xpect-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 361a959e915dc1ffca0777a7b726fe39491f7a0e96262b294e4bd7863621c6dd |
|
MD5 | cc12787fcfc14a0edb6c2aeca2f2f198 |
|
BLAKE2b-256 | cd5736fa6216fdb7da2fcd42f8b6a053354a1e86604f4605eebfc57fb7817a41 |