Opening Multiple files at one time

subhabrata.banerji at gmail.com subhabrata.banerji at gmail.com
Mon Apr 20 07:59:59 EDT 2015


Dear Group,

I am trying to open multiple files at one time. 
I am trying to do it as,

 for item in  [ "one", "two", "three" ]:
       f = open (item + "world.txt", "w")
       f.close()

This is fine. But I was looking if I do not know the number of
text files I would create beforehand, so not trying xrange option
also. 

And if in every run of the code if the name of the text files have
to created on its own. 

Is there a solution for this? 

If anybody may please suggest. 

Regards,
Subhabrata Banerjee. 



More information about the Python-list mailing list