PYQT5实现文件目录浏览

    def setBrowerPath(self): 
        download_path = QtWidgets.QFileDialog.getExistingDirectory(self,  
                                    "浏览",  
                                    "E:workspace")   
        self.lineEdit.setText(download_path)  

点击button “浏览”可以打开对应的文件目录,并将选定的文件目录写入 lineEdit文本框内。

原文地址:https://www.cnblogs.com/gaigaige/p/7883603.html