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

Source Distribution

xpect-1.5.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xpect-1.5.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file xpect-1.5.0.tar.gz.

File metadata

  • Download URL: xpect-1.5.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xpect-1.5.0.tar.gz
Algorithm Hash digest
SHA256 8ea0eb0d8a10cb9944cf08b180bc9e81af71077087f61a6c009ce04f6c4a9c99
MD5 8c6c26b9fba52c4f268278eadc6132e5
BLAKE2b-256 4fbdfa34fba4c9e9946537a6196fbca21b686f1093a887b03b094c26ee08967c

See more details on using hashes here.

File details

Details for the file xpect-1.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for xpect-1.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 70df472203c101bb05936cf53ef421d4d5fdd0b9b95fb3819816c5c251ad73c9
MD5 d11a3f7f1f5ff37085779d7949a50833
BLAKE2b-256 d61f9c0aae232d86205a83dd049885e7198c6c06eb47daa416c358f090b37d2d

See more details on using hashes here.

Supported by

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