
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to create a directory recursively using Python?
To create a directory recursively, provide the path you want to create to the os.makedirs(path). To create a directory recursively, you need to specify exists_ok as True to allow existing folders.
import os os.makedirs('my_folder/another/folder', exists_ok=True)
- Related Articles
- How to create a Directory recursively using Java?
- How to remove a directory recursively using Python?
- How to create a directory using Python?
- How to scan through a directory recursively in Python?
- How to create a unique directory name using Python?
- How to create a zip archive of a directory using Python?
- How to create a directory using Java?
- How to create a Directory using C#?
- How to zip a folder recursively using Python?
- How to create a directory hierarchy using Java?
- How to remove a directory using Python?
- How to rename multiple files recursively using Python?
- How to calculate a directory size using Python?
- How to create a directory in project folder using Java?
- How to rename directory using Python?

Advertisements