def cmdloop(self):
history_location = os.path.join(os.path.dirname(os.path.abspath(__file__)),".history")
history = FileHistory(history_location)
print(frontend_message.get_welcome_message())
while True:
try:
while True:
text = prompt(self.prompt, lexer=PythonLexer,
completer=self.completer,
style=DocumentStyle, history=history)
res = self.processor.forward(text)
if(isinstance(res, str)):
res = res.strip()
if(len(res)>0):
print(res)
elif res is not None:
print(res)
except KeyboardInterrupt as ex:
print("^C")
except EOFError:
print(frontend_message.get_bye_message())
break
except Exception as ex:
print(ex)
评论列表
文章目录