I am trying to create folders using the following code. Something is not correct and leads to error:
"TypeError: 'str' object is not callable"
import os, sys
a= [4,3,2,1]
print len(a)
for idx in range (len(a)):
newpath = r'E:\test\tool\folder_%s'(idx)
if not os.path.exists(newpath): os.makedirs(newpath)
Using os.makedirs I can create folders. However, I am not able to suffix those folders in a loop. Any ideas can be helpful. Thanks.