Skip to main content

An interactive shell for Python scripts.

Project description

Documentation Status pypi version PyPI - Python Version GitHub License

pash


About

Since many of my recent Python projects have included an interactive shell / command prompt of some sorts, I've decided to write my own package for it, so that I won't have to think of a new way of handling commands everytime.

I hope it can be of some use to other Python programmers as well, as it'll hopefully make my life a lot easier.

Install

Installing pash is very easy thanks to pip:

python3 -m pip install pash-cmd

Usage

First, create a shell ...

from pash.shell import Shell
sh = Shell(prompt='$ ')

... and then, simply add as many commands as you want/need!

from pash.command import Command
sh.add_command(Command('ping', callback=pong))
...

You can even create cascading commands ...

from pash.command import CascCommand
sh.add_command(CascCommand('go', cmds=[
    Command('north', callback=gnorth),
    Command('south', callback=gsouth),
]))
...

Documentation

The full docs are hosted here. (Please excuse the messiness, it's my first time working with sphinx, readthedocs, etc. ^^)


... Matthias M. (April 2020)

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

pash-cmd-0.0.7.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distributions

pash_cmd-0.0.7-py3.9.egg (19.0 kB view hashes)

Uploaded Source

pash_cmd-0.0.7-py3-none-any.whl (20.8 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