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 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


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)

Uploaded Source

Built Distribution

xpect-1.1.0-py2.py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page