-
Notifications
You must be signed in to change notification settings - Fork 4
/
shell.py
31 lines (28 loc) · 1008 Bytes
/
shell.py
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
import main
import sys
Debug=False
try:
if len(sys.argv)>1:
main.run_from_file(sys.argv[1])
else:
while True:
text = input("बाजी >")
text = text.strip()
if len(text)==0:
continue
result, error = main.run("<मुख्य>", text, debug=Debug)
if error:
print(error.as_string())
elif result:
if len(result)==1:
print(result[0])
else:
print(result)
except KeyboardInterrupt as e:
print("\n--------------------")
print("कीबोर्डद्वारे प्रोग्राम थांबविला")
print("^^^^^^^^^^^^^^^^^^^^")
except BaseException as e:
print("\n--------------------")
print("प्रोग्राम चालू असताना त्रुटी आली")
print("^^^^^^^^^^^^^^^^^^^^")