Skip to main content

Programmed dialogue with interactive streams.

Project description

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 $ ")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
xpect-3.1.1-py2.py3-none-any.whl (4.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Mar 1, 2017
xpect-3.1.1.tar.gz (11.4 kB) Copy SHA256 hash SHA256 Source None Mar 1, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page