PyOS/os.py

31 lines
791 B
Python
Raw Normal View History

2024-10-06 18:19:52 -04:00
import os
print("[OS] Started up the kernel")
2024-10-06 18:16:05 -04:00
print("[AutoLogin] Logged into user root")
def hello():
print("Hello! You've activated the hello command.")
def help_command():
print("This is the help command. Use --help for assistance.")
2024-10-06 18:19:52 -04:00
def bash_command():
os.system("bash")
2024-10-06 18:16:05 -04:00
def custom_terminal():
commands = {
"hello": hello,
2024-10-06 18:19:52 -04:00
"help": help_command,
"bash": bash_command
2024-10-06 18:16:05 -04:00
}
print("Welcome to your custom terminal! Type 'exit' to quit.")
while True:
2024-10-06 18:19:52 -04:00
command = input("root@python $").strip()
2024-10-06 18:16:05 -04:00
if command == "exit":
break
elif command in commands:
commands[command]()
else:
print(f"Unknown command: {command}")
if __name__ == "__main__":
custom_terminal()