Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Create a directory if it doesn't exist.

        def make_directory(path):
    """
    Create a directory if it doesn't exist.
    """

    if not os.path.exists(path):
        try:
            os.makedirs(path)
        except OSError as msg:
            raise DitzError(msg)
        


src/p/y/pyditz-0.6/ditz/objects.py   pyditz(Download)
from datetime import datetime
 
from util import make_directory, check_value, DitzError
from flags import (STATUS, RELSTATUS, RELEASED, UNRELEASED, BUGFIX,
                   FEATURE, DISPOSITION, UNSTARTED, TYPE, SORT, CLOSED)
        """
 
        make_directory(dirname)
        path = os.path.join(dirname, self.filename)
 

src/p/y/pyditz-0.6/ditz/exporter.py   pyditz(Download)
from pkg_resources import resource_exists, resource_listdir, resource_filename
 
from util import make_directory
from config import config
import pkginfo
    def export(self, dirname):
        # Create output directory if required.
        make_directory(dirname)
 
        # Write files.