how to set the camera follow path using python script
Thanks for @poor 's comment. It can be done in the way of 

make object A a parent of object B via Python

specifically, it needs to be coded like:

camera = bpy.data.objects['Camera']
path = bpy.data.objects['NurbsPath']
lamp = bpy.data.objects['Lamp']

camera.select = True
lamp.select = True
path.select = True

bpy.context.scene.objects.active = path #parent

bpy.ops.object.parent_set(type='FOLLOW') #follow path


you can find the objects name in python console with 

list(bpy.data.objects)