Home >Backend Development >Python Tutorial >Basic steps to create a folder in python
How to create a folder in python?
Related recommendations: "python Video"
##The steps are as follows:
First You can use exists in Python's os module to determine whether the directory exists. #If the directory or file exists, os will return a TRUE result. #To create a directory, you can first use getcwd to obtain the current directory and then splice the directory name to create the folder. The mkdir in Python's os module can also directly use the absolute path to create an empty folder. If you want to create a multi-level directory, you need to use makedirs in the os module.The above is the detailed content of Basic steps to create a folder in python. For more information, please follow other related articles on the PHP Chinese website!