![]() Os.mkdir(path) will create the given directory only, but it will not create the intermediate directory in the given path.įor example we want to create ‘temp/tempDir2/sample’ in current working directory. Or we should first check if given folder exists or not i.e. Print("Directory ", dirName, " already exists") Print("Directory ", dirName, " Created ") So to avoid errors either we should call it using try / except i.e. If directory already exists then it will raise FileExistsError Error. It creates the directory ‘tempDir’ in current directory. It creates a directory with given path i.e. ![]() ![]() Python’s OS module provides a function to create a directory i.e. In this article we will discuss different APIs in python to create directories. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |