-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyTerm Terminal Edition.py
More file actions
47 lines (41 loc) · 1.62 KB
/
PyTerm Terminal Edition.py
File metadata and controls
47 lines (41 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import os
import platform
def clear_screen():
# Unterschiedliche Befehle zum Bildschirm löschen für Windows und Unix-basierte Systeme
if platform.system() == "Windows":
os.system("cls")
else:
os.system("clear")
def main():
# Titel setzen (funktioniert nur auf Windows)
if platform.system() == "Windows":
os.system("title PyTerm")
# ASCII-Art und Begrüßung anzeigen
ascii_art = r"""
_______ _________ _______ _______ _______
( ____ )|\ /|\__ __/( ____ \( ____ )( )
| ( )|( \ / ) ) ( | ( \/| ( )|| () () |
| (____)| \ (_) / | | | (__ | (____)|| || || |
| _____) \ / | | | __) | __)| |(_)| |
| ( ) ( | | | ( | (\ ( | | | |
| ) | | | | | (____/\| ) \ \__| ) ( |
|/ \_/ )_( (_______/|/ \__/|/ \|
"""
print("PyTerm the Python Terminal Emulator by Emil")
print(ascii_art)
# Endlosschleife für Benutzereingaben
while True:
try:
command = input("PyTerm> ")
if command.lower() in ["exit", "quit"]:
break
elif command.lower() == "clear":
clear_screen()
print("PyTerm the Python Terminal Emulator by Emil")
print(ascii_art)
else:
os.system(command)
except KeyboardInterrupt:
print("\nZum Beenden 'exit' oder 'quit' eingeben.")
if __name__ == "__main__":
main()