Hello I am trying to create a subdirectory called eeg within another subdirectory in the following way:
for idx in range(0,5):
path = '/Users/fred/Dropbox/1_Mon_Switch/Statistiques/Python/RenameFileBids/Raw/'
dest_dir = "{}{}{:02d}{}".format(path,'sub-',idx,'/eeg/')
os.mkdir(dest_dir)
When I run this code I have the following error message : FileNotFoundError: [Errno 2] No such file or directory: '/Users/fred/Dropbox/1_Mon_Switch/Statistiques/Python/RenameFileBids/Raw/sub-00/eeg/'
This code is running fine when I remove the second subfolder /eeg/ the sub-00 directory is created. Could you tell me where I'm wrong? Thank you for your help