How to copy BGE logic from one object to another using script? How to copy BGE logic from one object to another using script?

I use the following code (coppied from an addon) to create a duplicate of an object ...

def copyObject(scene, name, copyobj, location ):

  # Create new mesh
  mesh = bpy.data.meshes.new(name)

  # Create a new object.
  ob_new = bpy.data.objects.new(name, mesh)
  ob_new.data = copyobj.data.copy()
  ob_new.scale = copyobj.scale
  ob_new.location = location
  scene.objects.link(ob_new)

  return ob_new


But this does not copy the game logic from the original object.

Thanks!
To copy game logic from one object to one or many others:

Select the other object (or multiples using shift) first (object you would like to copy game logic nodes to)

Select the object you want to copy from (using shift to select)

Click Object->Game->Copy Logic Bricks

( or script as bpy.ops.object.logic_bricks_copy() )

Can be done for Properties as well as Physics properties.

Is this the type of copy you are looking for?