code: def splitname(path):
      
      dirpath, filename = os.path.split(path)
      # we don't use os.path.splitext here because we want all extensions,
      #  not just the last, to be put in exts
      name, exts = filename.split(os.extsep, 1)
      return dirpath, name, exts
docs: Split a path into a directory, name, and extensions.