PYQT5实现文件目录浏览时间:2023-03-08 23:47:48 def setBrowerPath(self): download_path = QtWidgets.QFileDialog.getExistingDirectory(self, "浏览", "E:\workspace") self.lineEdit.setText(download_path) 点击button “浏览”可以打开对应的文件目录,并将选定的文件目录写入 lineEdit文本框内。