How to create logic bricks programmatically in Blender?

I know this is a really old post, but the information is outdated. It is now possible to add actuators and sensors with python: http://www.blender.org/documentation/blender_python_api_2_60_6/bpy.ops.logic.html

In case anyone else is looking for the info.


So -- as it is, there is no way to create the logic bricks straight from Python.

When you instantiate an object in ther BGE (like with an add object actuator), the logic bricks from the instantiated object comes with it - and you can change and rearrange those - including the rewiring of the sensors, controler and actuators

I think this is the current workaround: you create a blank matrix of generic senor, controlers and actuators, and as you add new objects into a scene, call a function that fill-in the parameters for the logic blocks and do the required wiring.