Programmed dialogue with interactive streams.


Keywords
expect
License
MIT
Install
pip install xpect==3.1.1

Documentation

buildstatus

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 serial
>>> import expect
>>> serial_linux = serial.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 $ ")