-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.py
More file actions
24 lines (24 loc) · 695 Bytes
/
python.py
File metadata and controls
24 lines (24 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
try:
arg = args[1]
try:
with open(args[1],"r+") as file:
try:
exec(file.read())
except Exception as e:
print("[red bold]ERROR:",e)
except:
print("[red bold]file does not exist !")
except:
running = True
print("Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on IZOS")
print("Type exit() to exit the interpreter")
while running:
com = input(">>> ")
if com == "exit()":
print("Bye !")
running = False
else:
try:
exec(com)
except Exception as e:
print(e)