How do I create a multiple different folders that also contain multiple different folders using python?
My path is: './work/animals/'. The 'animals' directory contains the folders 'cat', 'dog', 'horse', 'mouse', 'lion', 'cheetah', 'rat', 'baboon', 'donkey', 'snake' and 'giraffe'.
I have managed to write the part that creates all the animal folders (code below), but I also wanted to create three other subfolders namely 'male', 'female' and 'uncategorized' in all the folders in animals.
import os
root_path = './work/animals/'
folders = ['cat','dog','horse','mouse','lion','cheetah','rat','baboon','donkey','snake','giraffe']
for folder in folders:
os.mkdir(os.path.join(root_path,folder))