A tool that help using python function into terminal
Project description
easy-terminal
A library that help you to debug the code in terminal
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()
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.4.1.tar.gz
(4.3 kB
view details)
Built Distribution
File details
Details for the file easy-terminal-0.4.1.tar.gz
.
File metadata
- Download URL: easy-terminal-0.4.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93359de7fdc63ff883d4318642d5b4b52e1604cf4a76aad45332db7a409d1bf1 |
|
MD5 | 8101e9434a4c03d55b7fde41c10dca01 |
|
BLAKE2b-256 | cba5ce0f8cd0ea807a85ae01fb5235fd05e252a3930a47772ed2e47b33ed3c8a |
File details
Details for the file easy_terminal-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: easy_terminal-0.4.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a05464350e9d04b873fc97557e0c06bd741867c2c50b0c7a2dc1f0c1ec75804 |
|
MD5 | c18a6e6dcdd25939a100191bd7a3e6f0 |
|
BLAKE2b-256 | caddb369a9dcee47c83aeea049e4e3f4d22a041e341784aa98f0ed796ab14434 |