PYQT5实现文件目录浏览

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

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

posted on 2017-11-23 10:31  改改哥  阅读(16295)  评论(0编辑  收藏  举报