I Made A Script That Can Dynamically Add Commands To The App, Bind A Function To It And Give It All The Args Of The Command As Its First Parameter,
import time
import os
class Data:
init = 0
cmd = ""
ss = "$"
commands = {}
default = []
temp = {"0":[]}
startup = [False, "", ""]
error = True
bucket = []
alrt = ""
wait = 0
class File:
def read(self, filename):
with open(filename) as f:
return f.read()
def write(self, filename, contents):
with open(filename, "w") as f:
f.write(contents)
return 1
class Shell:
def clear(self):
os.system("cls")
def run(self, command):
if Shell != "":
try:
Data.commands[command[0]]
except:
print("Invalid Command")
def start(self):
if Data.alrt != "":
print(Data.alrt)
Data.alrt = ""
time.sleep(Data.wait)
Data.wait = 0
cmd = input(Data.ss + " ")
self.run(cmd.split(" "))
self.start()
def symbol(self, symbol: str):
Data.ss = symbol
def new(self, command, function):
Data.commands.update({command: [function]})
def delete(self, command):
del Data.commands[command]
def getcommands(self):
return Data.commands
def getcommand(self, command):
return Data.commands[command]
def reset(self):
Data.commands = Data.default
def show(self, parameters):
print(" ".join(parameters[1:]))
def startup(self, message, dialog):
Data.startup[0] = True
Data.startup[1] = message
Data.startup[2] = dialog
def alert(self, message):
Data.alrt = message
def wait(self, timeAmount):
Data.wait = timeAmount
Data.default = Data.commands
It Is Under Development And The Startup Feature Does Not Work Yet But Everything Else Does.
Hope This Helps!