I have my list
listnumbers='1.0,5.0,6.0,7.0,9.0,10.0'
I have my filepath
filepath=r'C:\ArcGIS\Projects\Name'
I also have a for loop that attempts to take the values from listnumbers
for line in listnumbers:
for value in line.split(','):
os.makedirs(os.path.join(path,value))
though it creates the first empty folder which is 1, it does not create the following folder which would be 5.
Instead i get an error message that says
FileExistsError: [WinError 183] Cannot create a file when that file already exists : 'C:\ArcGIS\Projects\Name'
I need help. I feel I'am close and might need to make a small adjustment.
your code is a bit weird... your
listnumbersis not a list but a string, so when you dofor line in listnumbers:the variablelineruns over each character oflistnumbersThis code works for me: