Skip to main content

Automate interactive CLI tools actions

Project description

pexpect-executor

Build Bugs Code Smells Coverage Lines of Code Quality Gate Status

Automate interactive CLI tools actions to create previews or tests in Python.


Examples

#!/usr/bin/env python3

# Modules libraries
from pexpect_executor import Executor

# Configure
Executor.configure(host='previews', tool='pexpect-executor')

# List
Executor('ls -la', workdir='/').\
    read().\
    finish()

# More
Executor('ls -la | more -5', workdir='/').\
    read().\
    wait(0.5).\
    press('s').\
    read().\
    wait(0.5).\
    press('s').\
    read().\
    wait(0.5).\
    press('b').\
    read().\
    wait(0.2).\
    press('b').\
    read().\
    wait(0.2).\
    press(' ').\
    read().\
    wait(1).\
    press(Executor.KEY_ENTER).\
    read().\
    wait(1).\
    press('q').\
    finish()

# Prompt
Executor('').\
    finish()

Dependencies

  • pexpect: Interactive console applications controller

References

  • gitlabci-local: Launch .gitlab-ci.yml jobs locally
  • peek: Simple GIF screen recorder
  • PyPI: The Python Package Index
  • twine: Utility for publishing on PyPI

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pexpect_executor-0.0.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded 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