def mkdir(path, recursive=True):
    """Create a directory at the specified path. By default this function
    recursively creates the path.

      >>> if mkdir('/tmp/one/two'):
      ...     print('OK')
      OK
    """
    if os.path.exists(path):
        return True
    try:
        if recursive:
            os.makedirs(path)
        else:
            os.mkdir(path)
    except OSError as error:
        log.error('mkdir: execute failed: %s (%s)' % (path, error))
        return False
    return True
def mkdir ( path , recursive = True ) : if os . path . exists ( path ) : return True try : if recursive : os . makedirs ( path ) else : os . mkdir ( path ) except OSError as error : log . error ( 'mkdir: execute failed: %s (%s)' % ( path , error ) ) return False return True
Create a directory at the specified path. By default this function
    recursively creates the path.

      >>> if mkdir('/tmp/one/two'):
      ...     print('OK')
      OK