code: def select_file(self, edit, filters=None):
          
          basedir = osp.dirname(to_text_string(edit.text()))
          if not osp.isdir(basedir):
              basedir = getcwd_or_home()
          if filters is None:
              filters = _("All files (*)")
          title = _("Select file")
          filename, _selfilter = getopenfilename(self, title, basedir, filters)
          if filename:
              edit.setText(filename)
docs: Select File