Advertisement
Dodikman

Some shit

May 25th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import json
  2. import os
  3.  
  4. infoFile = open("data/info.json")
  5. info = json.load(infoFile)
  6. infoFile.close()
  7.  
  8. commandsInfoFile = open("data/commandsInfo.json")
  9. commandsInfo = json.load(commandsInfoFile)
  10. commandsInfoFile.close()
  11.  
  12. version = info["version"]
  13.  
  14. def cprint(toPrint):
  15.     print("Log: ", toPrint)
  16.  
  17. print("Console Version: ", version)
  18.  
  19. working = True
  20.  
  21. while working:
  22.     command = input("/>")
  23.  
  24.     if command.lower() == "exit":
  25.         cprint("Stopped Console")
  26.         exit()
  27.  
  28.     if command.lower() == "help":
  29.         count = 1
  30.         for key, val in commandsInfo.items():
  31.             print(count, ". ", key, " - ", val)
  32.             count += 1
  33.     else:
  34.         for key, val in commandsInfo.items():
  35.             if command.lower() == key.lower():
  36.                 cprint("Launched Command: " + key)
  37.                 fileName = os.getcwd() + "\data\commands\\" + key + ".bat"
  38.                 os.system(fileName)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement