📅  最后修改于: 2022-03-11 14:45:31.631000             🧑  作者: Mango
from tkinter import messagebox
from tkinter import filedialog
from openpyxl.utils.exceptions import InvalidFileException
...
def browseXLL(self,event):
try:
file = filedialog.askopenfilename()
except InvalidFileException:
self.window.destroy()
self.__init__()