How can I set the rigid_body.kinematic to "Animated" in Python?

After making an object a rigid body: How can I set the rigid_body.kinematic to “Animated” in Python? Using the tooltip command does not seem to work.

>>> my_plane=bpy.data.objects[myname]
>>> my_plane.rigid_body.kinematic=True
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
AttributeError: ‘NoneType’ object has no attribute ‘kinematic’

OK, its working like this:

bpy.data.objects[myname].rigid_body.kinematic=False

bpy is the Blender API not the BGE API. Do not use it inside a Python controller.