1- # I integrated my own calculator program named PMDMcalc in PyTerm. Isn 't it cool?
1+ # Kind of a sudo command but its name is super and it gives use you "supercommands" that a normal user can 't use. Password is SECRETCOMMAND
22
3+ def supercommand (command ):
4+ password = "SECRETCOMMAND"
5+ enter = input ("What's the secret password? Say it:" )
6+ if enter == password :
7+ # If the password is correct, you can use the commands above:
8+ # Type command is repeating what you wrote.
9+ if command == "type" :
10+ return input ()
11+ # Superexit command let's you exit the super command without ending the application.
12+ elif command == "superexit" :
13+ return "Superexiting..."
14+ ßß
15+ # I integrated my own calculator program named PMDMcalc in PyTerm.
16+
317def pmdmcalc ():
418 operation = input ("hint: + - / *. Type the symbol here: " ).strip ()
519
@@ -32,10 +46,13 @@ def pmdmcalc():
3246
3347def handle_command (command ):
3448 command = command .strip ().lower ()
49+ # Help command let's you see all the commands in PyTerm.
3550 if command == "help" :
36- return "Available commands: help, exit, info, pmdm"
51+ return "Available commands: help, exit, info, pmdm, super"
52+ # Exit command helps you exit the PyTerm application.
3753 elif command == "exit" :
3854 return "Exiting..."
55+ # Info command let's you know the version of PyTerm and other data.
3956 elif command == "info" :
4057 return ("""
4158PPPP y y TTTTT EEEE RRRR M M
@@ -49,14 +66,21 @@ def handle_command(command):
4966 Created: Twenty-Third April 2024
5067 Operating System: MacOS
5168 """ )
69+ # PMDM command let's you use PMDMcalc directly from PyTerm.
5270 elif command == "pmdm" :
5371 return pmdmcalc ()
72+ # Told about super at the start.
73+ elif command == "super" :
74+ return
75+ # If there's no commands that you entered, it shows an error.
5476 else :
5577 return "PyTerm: unknown command"
56-
78+ # Let's you use the terminal without ending it everytime when entered a command.
5779while True :
5880 user_input = input ()
5981 output = handle_command (user_input )
6082 print (output )
83+ if user_input .lower ().strip () == "superexit" :
84+ handle_command ()
6185 if user_input .lower ().strip () == "exit" :
6286 break
0 commit comments