Quick and dirty fdisk-like REPLs
Project description
Repple
Quick and dirty opinionated fdisk-style REPLs
- Whitespace-separated command and arguments
- Except unary string functions
- Selector prompt
from repple import Repple
r = Repple()
r['a'] = (lambda x: print(x+1), "Adds one to first argument and prints it")
r['A'] = lambda x: print(x+2)
def variadic_fn(*args):
print(*[a+1 for a in args])
r.main()
Command: h
q Exits the program
h Show this help
a <x> Adds one to first argument and prints it
A <x>
b <args>
Command: a 1
2
Command: A 1
3
Command: b 1 2
2 3
Selector
from repple import Repple
r = Repple()
r['a'] = lambda: print(Repple.selector(['a','b','c']))
r.main()
Command: a
1: a
2: b
3: c
Select your items: 1 3
['a', 'c']
Unary string function
from repple import Repple
r = Repple()
r.add_string_func('p', lambda x: print(x))
r.main()
Command: p Hello world!
Hello world!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
repple-0.3.4.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file repple-0.3.4.tar.gz.
File metadata
- Download URL: repple-0.3.4.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f669100cf374c7939ae68804cbce684ba1f5ee907fe8eae14e64c780f7c7941b
|
|
| MD5 |
ac59d3c28eea731d62a584ca104371cc
|
|
| BLAKE2b-256 |
610d3754a4d94bc33131413ba5cf335f1f4e08e7553e12202565b4ba080fc6c8
|
File details
Details for the file repple-0.3.4-py3-none-any.whl.
File metadata
- Download URL: repple-0.3.4-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3c060c363be99fc5438e257b3601bba15bd135a69009db9a7bfc594efce0c12
|
|
| MD5 |
0b785ea9cac2bc5b4a89ebedc5cd1aa3
|
|
| BLAKE2b-256 |
2d7251f0eaa84576d16980185e2e0ff5c216220885f8a2b11a64d3f2b13efd1d
|