generate template with a python script