python script to generate pages