cocos.layer.python_interpreter module

class PythonInterpreterLayer

Bases: cocos.layer.util_layers.ColorLayer

Runs an interactive Python interpreter as a child Layer of the current Scene.

draw()
on_enter()
on_exit()
on_key_press(symbol, modifiers)
on_resize(x, y)
on_text(symbol)
on_text_motion(motion)
cfg = {'code.font_size': 12, 'code.color': (255, 255, 255, 255), 'code.font_name': 'Arial', 'caret.color': (255, 255, 255)}
doing_more = False
is_event_handler = True

enable pyglet’s events

name = 'py'
prompt = '>>> '

python prompt

prompt_more = '... '

python ‘more’ prompt