python script for generating csv file