A tool that help live debugging
Project description
easy-terminal
A library that help you to convert function into terminal command
Getting started
Installation
pip install easy-terminal
Require easy-events>=2.2.0
GitHub : Github
Usages
Add the @terminal() before the function you want to try in the terminal Use @main() to redirect any input to the function linked
Code example
from easy_terminal import terminal
help_msg = """
pc processor ram : will print the informations of the pc
hello : will print world
help : will show this message
"""
@terminal(aliases=["help"])
def h():
print(help_msg)
class A:
nb = 1
def __init__(self, nb=5):
self.nb = nb
@terminal()
def hello(self):
print("world", self.nb, "\n")
a = A(6)
@terminal()
async def hello():
print("world\n")
@terminal()
def pc(processor: str = "intel", ram: str = "8go"):
print(f"processor: {processor}\nram : {ram}\n")
@main()
def principal(car: str = "mercedes"):
print(f"Your car is a {car}")
"""
>hello
world
>A.hello
world 1
>a.hello
world 6
>pc
processor: intel
ram : 8go
>pc amd
processor: amd
ram : 8go
>pc amd 16go
processor: amd
ram : 16go
>help
pc processor ram : will print the informations of the pc
hello : will print world
help : will show this message
>peugot
Your car is a peugot
"""
This lib make you run python function in a terminal
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
easy-terminal-0.5.2.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file easy-terminal-0.5.2.tar.gz
.
File metadata
- Download URL: easy-terminal-0.5.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1cc7dbf10051e0d862f8d646fe859fc0201076256a79566e9a0176662d085bd |
|
MD5 | fb8cade4f165c01a487664467df32893 |
|
BLAKE2b-256 | 8e6ca56e173ce1f37b1e4afc32340e9268d89e8b4b39a6e030045b2fa995e703 |
File details
Details for the file easy_terminal-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: easy_terminal-0.5.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fdf4723f587780b6ba78224738742bd81cbec02f3b98b0c897d7ff1e8c8760c |
|
MD5 | cbf2636e60cb49fbc6949cb96f5ec5f0 |
|
BLAKE2b-256 | a1697954fbd27737bb9fb695b170a30331f01abcbc050b79606e581872a5bc81 |