As of Python >=3.2
, os.makedirs()
can take a third optional argument exist_ok
:
os.makedirs(mydir, exist_ok=True)
More Related Contents:
- Unicode encoding for filesystem in Mac OS X not correct in Python?
- Lazy Method for Reading Big File in Python?
- Reading binary file and looping over each byte
- Is it possible to modify lines in a file in-place?
- open() gives FileNotFoundError/IOError: Errno 2 No such file or directory
- How to open a file using the open with statement
- How to check type of files without extensions? [duplicate]
- How to write a multidimensional array to a text file?
- Read file from line 2 or skip header row
- Python 32-bit memory limits on 64bit windows
- How can I search sub-folders using glob.glob module? [duplicate]
- Monitoring contents of files/directories? [duplicate]
- Writing a list to a file with Python, with newlines
- File read using “open()” vs “with open()” [duplicate]
- Create file but if name exists add number
- Filling a queue and managing multiprocessing in python
- How to open a password protected excel file using python?
- pandas to_csv output quoting issue
- Python Pandas: How to read only first n rows of CSV files in?
- How to safely open/close files in python 2.4
- python close file descriptor question
- How do you pass a Queue reference to a function managed by pool.map_async()?
- ValueError : I/O operation on closed file
- How to read a single character at a time from a file in Python?
- Queue.Queue vs. collections.deque
- How to read lines from a file in python starting from the end
- Python – What is queue.task_done() used for?
- Is it possible to get writing access to raw devices using python with windows?
- pickle.load() raising EOFError in Windows
- Saving response from Requests to file