How to duplicate objects with constraints using script?
Here is a python script that will duplicate all objects in the current scene:

import bpy

for obj in bpy.context.scene.objects:
    obj.select = True

# use this to duplicate without links
bpy.ops.object.duplicate()

# use this to duplicate with links
bpy.ops.object.duplicate_move_linked()


A few things to note about your code:


obj.select is just a variable...you know this because it doesn't have the parentheses.
You would have been recursively duplicating because that call was inside of your for loop.