pyqt打开文件夹

    #输出文件路径函数
    def shuchuwjlj(self):
        #得到路径地址
        get_filename_path, ok = QFileDialog.getOpenFileName(self,
                                                            "选取单个文件",
                                                            "C:/",
                                                            "All Files (*);;Text Files (*.txt)")
        #将地址传入textedit中
        self.ui.lineEdit_3.setText(str(get_filename_path))
        print(str(get_filename_path))

你可能感兴趣的:(python)