code: def build_tree_pathname(filename, directory_depth=8, pathname_separator_character=os.sep):
      
      pathname = ''
      (filename_without_extension, _file_extension_) = os.path.splitext(filename)
  
      for i in range(min(directory_depth, len(filename_without_extension))):
          pathname += filename_without_extension[i] + pathname_separator_character
  
      return pathname
docs: Return a pathname built of the specified number of sub-directories,
      and where each directory is named after the nth letter of the filename
      corresponding to the directory depth.
  
      Examples::
  
        >>> build_tree_pathname('foo.txt', 2, '/')
        'f/o/'
        >>> build_tree_pathname('0123456789abcdef')
        '0/1/2/3/4/5/6/7/'
  
      @param filename: name of a file, with or without extension.
  
      @param directory_depth: number of sub-directories to be generated.
  
      @param pathname_separator_character: character to be used to separate
             pathname components, such as '/' for POSIX and '\\' for
             Windows.  If not defined, the default is the character used by
             the operating system ``os.sep``.
  
      @return: a file pathname.