There is a lot of programming code for creating folders in Python, Make a memorandum just in case.
You can create folders, but If the folder already exists, you will get an error. Use if to avoid it.
make_folder.py
import os
new_path = "demo_folder"#Folder name
if not os.path.exists(new_path):#If there is no directory
os.mkdir(new_path)#Create the folder name you want to create
The first time you run it, the folder will be created. When I run it a second time, nothing happens because the folder has already been created.
Recommended Posts