how would I change the camera viewpoint or scene object and output the image at the runtime I have done a 3D parking modeling,  I tried some python code to output the image of the rendering parking, .

output the image

  filepath = self.output_dir + '/images/' + str(i + 1) + '.png'                            
  bpy.context.scene.render.filepath = filepath


change the viewpoint 

bpy.data.objects['Camera'].location = [20,1,0]
bpy.data.objects['Camera'].rotation_euler = [20,30,40) ]


My objective is to let python program collect the images in all camera perspective,  what I can do at the current time is to use the render function during the for loop

  for i in range(0,  car_num): 
    self.changeCameraPerspective()
    self.saveLocalImage(i)
    bpy.ops.render.render(write_still = True) 


however each new rendering take 2 minutes to load everything from the beginning.

so my question is how to program to make the scene change the camera perspective or modify the object at the runtime (without loading and rendering 2 minutes every time when a small change occurs) , like what we do in the game or 3d modeling?
Well there are 2 options you have here.
1. Optimize all your materials and bake all static shadows. That way the rendering will take as little time as possible. 
2. Once you load the scene, move the camera to all locations you want to render but don't render, just add keyframes. When you add keyframes to all locations then start to render the number of frames you need. That way you will only prepare for rendering and load into memory once and then render everything you need in one pass.