Python code to generate files in a folder