May-07-2018, 01:06 PM
(May-07-2018, 12:27 PM)Larz60+ Wrote:files = ['ctrlptdata_0', 'ctrlptdata_1', 'ctrlptdata_2', 'ctrlptdata_3'] for num, filename in enumerate(files): with open(filename, 'w') as fp: fp.write(num)
Thank you for your reply @Larz60+ . I have learnt enumerator() function with your help. However, if I have 300 files, producing a files list like that, is so time consuming, is there a way to handle that problem by defining the file names, parametrically ?