Answers for "add directory to path in python and check if directory exists"

7

python check if directory exists and create

if not os.path.exists('my_folder'):
    os.makedirs('my_folder')
Posted by: Guest on July-21-2021
0

python create new folder in path that don't exist

def newfolder(path):
    import os
    try:
        os.mkdir(path)
    except:
        newfolder(path[:path.rindex("/")])
        newfolder(path)
Posted by: Guest on January-30-2022

Code answers related to "add directory to path in python and check if directory exists"

Python Answers by Framework

Browse Popular Code Answers by Language