
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How does mkdir -p work in Python?
mkdir -p is used to allow creating recursive directory making even if parent exists. To create a directory recursively, provide the path you want to create to the os.makedirs(path). To create a directory recusrively, you need to specify exists_ok as True to allow existing folders.
>>> import os >>> os.makedirs('my_folder/another/folder', exists_ok=True)
- Related Questions & Answers
- How does Python while loop work?
- How does garbage collection work in Python?
- How does class inheritance work in Python?
- How does issubclass() function work in Python?
- How does isinstance() function work in Python?
- How does Overloading Operators work in Python?
- How does ++ and -- operators work in Python?
- How does tuple comparison work in Python?
- How does Python dictionary keys() Method work?
- How does variable scopes work in Python Modules?
- How does [\d+] regular expression work in Python?
- How does \B regular expression work in Python?
- How does * operator work on list in Python?
- How does constructor method __init__ work in Python?
- How does jQuery.scrollTop() work?
Advertisements