python generate script