code: def select_directory(self):
          
          self.redirect_stdio.emit(False)
          directory = getexistingdirectory(self.main, _("Select directory"),
                                           getcwd_or_home())
          if directory:
              self.chdir(directory)
          self.redirect_stdio.emit(True)
docs: Select directory