Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- import os
- infoFile = open("data/info.json")
- info = json.load(infoFile)
- infoFile.close()
- commandsInfoFile = open("data/commandsInfo.json")
- commandsInfo = json.load(commandsInfoFile)
- commandsInfoFile.close()
- version = info["version"]
- def cprint(toPrint):
- print("Log: ", toPrint)
- print("Console Version: ", version)
- working = True
- while working:
- command = input("/>")
- if command.lower() == "exit":
- cprint("Stopped Console")
- exit()
- if command.lower() == "help":
- count = 1
- for key, val in commandsInfo.items():
- print(count, ". ", key, " - ", val)
- count += 1
- else:
- for key, val in commandsInfo.items():
- if command.lower() == key.lower():
- cprint("Launched Command: " + key)
- fileName = os.getcwd() + "\data\commands\\" + key + ".bat"
- os.system(fileName)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement