36 lines
735 B
Python
36 lines
735 B
Python
import os
|
|
|
|
try:
|
|
from repl.tdeck_repl import input
|
|
from repl.keys import show_keys
|
|
except:
|
|
pass
|
|
|
|
from deck.runtime import runcode
|
|
|
|
if 'tdeckboot.py' in os.listdir('/'):
|
|
from tdeckboot import *
|
|
|
|
if 'autoexec.py' in os.listdir('/'):
|
|
import autoexec
|
|
|
|
print("T-DeckARD REPL ready")
|
|
|
|
__cmd = ""
|
|
while True:
|
|
__line = input(",,, " if __cmd else "=>> " )
|
|
if __cmd:
|
|
__cmd += ("\n" + (" " if __line != "" else "") + __line)
|
|
else:
|
|
if __line.lower() == 'exit': break
|
|
__cmd = __line
|
|
try:
|
|
status, res = runcode(__cmd)
|
|
if status != 1:
|
|
__cmd = ""
|
|
if status == 0:
|
|
print("*ERROR* Exception:", str(res))
|
|
except Exception as __err:
|
|
print("*ERROR* Exception:", str(__err))
|
|
__cmd = ""
|