code: def select_directory(self):
          
          self.__redirect_stdio_emit(False)
          directory = getexistingdirectory(
                  self, _("Select directory"), self.path)
          if directory:
              directory = to_unicode_from_fs(osp.abspath(directory))
          self.__redirect_stdio_emit(True)
          return directory
docs: Select directory