[![Documentation Status](https://readthedocs.org/projects/pash/badge/?version=latest)](https://pash.readthedocs.io/en/latest/?badge=latest)
# 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.
## Usage
First, create a shell ...
```python
from pash.shell import Shell
sh = Shell(prompt='$ ')
```
... and then, simply add as many commands as you want/need!
```python
from pash.command import Command
sh.add_command(Command('ping', callback=pong))
...
```
You can even create _cascading commands_ ...
```python
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](https://pash.readthedocs.io). (Please excuse the messiness, it's my first time working with sphinx, readthedocs, etc. ^^)
---
... Matthias M. (April 2020)
Python库 | pash-cmd-0.0.1.tar.gz
版权申诉
58 浏览量
2022-04-12
16:14:17
上传
评论
收藏 8KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
- lcd daimalcd daima
- 电影领域-推荐算法-个性化内容-观影决策-电影推荐小程序.zip
- 电气控制PLC考试题库
- 如何使用MATLAB简介
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈