hi,
   I want to create a new python file like 'data0.0.5', but if it is already 
exist then it should create 'data0.0.6', if it's also exist then next like 
'data0.0.7'. I have done, but with range, please give me suggestion so that I 
can do it with specifying range.
I was trying this way and it's working also..

     i = 0
    for i in range(100):
        try:
            with open('Data%d.%d.%d.json'%(0,0,i,)): pass
            continue
        except IOError:
            edxCorrectDataFile = file('Data%d.%d.%d.json'%(0,0,i,), 'a+')
            break

But here I have defined range 100, Is it possible without range it create many 
required files?

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to