我正在尝试使用字典键创建新文件夹.代码是:
os.mkdir("Y:\\Bleeding-study\\MIMIC\\Notes\\randombins\\")
for key in index:
os.mkdir("Y:\\Bleeding-study\\MIMIC\\Notes\\randombins\\batch_%s\\"%str(key))
os.mkdir("Y:\\Bleeding-study\\MIMIC\\Notes\\randombins\\batch_%s\\%s\\"%(str(key),"config"))
os.mkdir("Y:\\Bleeding-study\\MIMIC\\Notes\\randombins\\batch_%s\\corpus\\"%str(key))
Run Code Online (Sandbox Code Playgroud)
错误是:
WindowsError: [Error 3] The system cannot find the path specified: 'Y:\\Bleeding-study\\MIMIC\\Notes\\randombins\\batch_0\\'
我认为这段代码会创建该文件路径名,那为什么会出现这个错误呢?