simple library to implement commands, events dispatchers
Run the following to install:
pip install commandkit
python -m pip install commandkit
if that didn't work, try replacing pip
with pip3
.
need help? or have bugs to report, let me know in here
from commandkit import CommandLine
cmder = CommandLine()
@cmder.command(name="foo")
def foo(cmd, num):
# do stuff with the cmd and num
...
@cmder.command(description="Calculate f(num) = num * 5")
def bar(num: int):
return num*5
cmder.process_command("foo kick 10")
print(cmder.process_command("bar 10")) # output: 50
you can check commandkit docs here