I have a list with folder names, for which I need to create directories in the current location and copy files into those created directories. Because files need to be copied to correct directories I am using a loop to go over each folder name in the list, create a directory based on the folder name and then copy files into it. Creating directories based on elements in the list is not a problem. The problem for me is how to capture those created directories in each loop iteration so that I can use it in my path when copying files in the next step.
Here is what I've tried:
dir = ['aaa','bbb')
for dir in dir_list:
print os.mkdir(path)
Folders are successfully created in current working directory during loop execution. But I also need to capture its names. I have printed results which shows that os.mkdir returns "None". How can I get created directory names in the loop instead of "None" object?