Class cocos.layer.python_interpreter.PythonInterpreterLayer

             object --+            
                      |            
    cocosnode.CocosNode --+        
                          |        
             object --+   |        
                      |   |        
scene.EventHandlerMixin --+        
                          |        
          base_layers.Layer --+    
                              |    
         util_layers.ColorLayer --+
                                  |
                                 PythonInterpreterLayer
Runs an interactive Python interpreter as a child Layer of the current Scene.

Methods

  __init__(self)
  on_enter(self)
  on_resize(self, x, y)
  on_exit(self)
  on_key_press(self, symbol, modifiers)
  on_text(self, symbol)
  on_text_motion(self, motion)
  draw(self)
Inherited from base_layers.Layer: push_all_handlers, remove_all_handlers Inherited from cocosnode.CocosNode: __contains__, add, are_actions_running, do, get, get_ancestor, get_children, pause, pause_scheduler, remove, remove_action, resume, resume_scheduler, schedule, schedule_interval, stop, transform, unschedule, visit, walk Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

Inherited from cocosnode.CocosNode: actions, camera, children, children_anchor_x, children_anchor_y, children_names, grid, is_running, rotation, scale, scheduled_calls, scheduled_interval_calls, skip_frame, to_remove, transform_anchor_x, transform_anchor_y, visible, x, y

Class Variables

  cfg = {'code.font_name': 'Arial', 'code.font_size': 12, 'code....
  name = 'py'
  prompt = ">>> "
python prompt
  prompt_more = "... "
python 'more' prompt
  doing_more = False
  is_event_handler = True
enable pyglet's events
Inherited from util_layers.ColorLayer: color, opacity Inherited from cocosnode.CocosNode: anchor, anchor_x, anchor_y, children_anchor, parent, position, transform_anchor

Method Details

__init__

(Constructor) __init__(self)
Overrides:
util_layers.ColorLayer.__init__

on_enter

on_enter(self)
Overrides:
util_layers.ColorLayer.on_enter

on_exit

on_exit(self)
Overrides:
util_layers.ColorLayer.on_exit

draw

draw(self)
Overrides:
util_layers.ColorLayer.draw

Class Variable Details

cfg

Value:
{'code.font_name': 'Arial', 'code.font_size': 12, 'code.color':(255, 2\
55, 255, 255), 'caret.color':(255, 255, 255),}