回复 楼主 huangyz_xy
请提供源码
openfile_name = QFileDialog.getOpenFileName(None,'选择文件','','数据库文件(*.xlsx , *.xls)')
from PyQt5.QtWidgets import QFileDialog, QWidget class Im_Form(QWidget): def openfile(self): directory1 = QFileDialog.getExistingDirectory(self, "选择文件夹", "/") print(directory1) print("打开选择文件对话框") openfile_name = QFileDialog.getOpenFileName(self,'选择文件','','数据库文件(*.xlsx , *.xls)')