Files
t-deckard/code.py
T

34 lines
670 B
Python
Raw Normal View History

2025-12-22 16:49:57 +02:00
import os
try:
from repl.tdeck_repl import input
from repl.keys import show_keys
except:
pass
from deck.runtime import runcode
2025-12-22 16:49:57 +02:00
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:
2025-12-22 16:49:57 +02:00
__cmd = ""
except Exception as __err:
print("*ERROR* Exception:", str(__err))
2025-12-22 16:49:57 +02:00
__cmd = ""