def create_dir(path):
 try:
  os.makedirs(path)
 except OSError as exception:
  if (exception.errno != errno.EEXIST):
   raise

def create_dir ( path ) : try : os . makedirs ( path ) except OSError as exception : if ( exception . errno != errno . EEXIST ) : raise
creates a directory atomically .