def console(self):
while True:<EOL><INDENT>if six.PY2:<EOL><INDENT>code = raw_input('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>code = input('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>print(self.eval(code))<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>break<EOL><DEDENT>except Exception as e:<EOL><INDENT>import traceback<EOL>if DEBUG:<EOL><INDENT>sys.stderr.write(traceback.format_exc())<EOL><DEDENT>else:<EOL><INDENT>sys.stderr.write('<STR_LIT>' + str(e) + '<STR_LIT:\n>')<EOL><DEDENT>time.sleep(<NUM_LIT>)<EOL><DEDENT><DEDENT>
starts to interact (starts interactive console) Something like code.InteractiveConsole