diff --git a/.gitignore b/.gitignore index c2a90a3..2e5ace4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,4 @@ 点名器.spec -build/点名器/点名器.exe.manifest -build/点名器/点名器.pkg -build/点名器/Analysis-00.toc -build/点名器/base_library.zip -build/点名器/EXE-00.toc -build/点名器/PKG-00.toc -build/点名器/PYZ-00.pyz -build/点名器/PYZ-00.toc -build/点名器/Tree-00.toc -build/点名器/Tree-01.toc -build/点名器/Tree-02.toc -build/点名器/warn-点名器.txt -build/点名器/xref-点名器.html -build/点名器/localpycs/pyimod01_archive.pyc -build/点名器/localpycs/pyimod02_importers.pyc -build/点名器/localpycs/pyimod03_ctypes.pyc -build/点名器/localpycs/pyimod04_pywin32.pyc -build/点名器/localpycs/struct.pyc -dist/点名器.exe -README_Vanila.html -README_Vanila.md -README.html -.history/README_Vanila_20221107204953.md -.history/README_Vanila_20221107204954.md -.history/.gitignore_20221107235331 -.history/点名器_20221107235625.pyw -.history/README_20221107235533.md -.history/.gitignore_20221107235715 -.history/点名器_20221108000106.pyw -.history/.gitignore_20221119173544 -dist/names.xls +build/ +dist/ +.history/ \ No newline at end of file diff --git a/点名器.pyw b/点名器.pyw index 022956b..95b4542 100644 --- a/点名器.pyw +++ b/点名器.pyw @@ -35,9 +35,9 @@ elim_rows = 1 percent_override = True try: - excel_data = excel.open_workbook(filename) - table = excel_data.sheets()[0] - win32api.SetFileAttributes(filename,win32con.FILE_ATTRIBUTE_HIDDEN) + with excel.open_workbook(filename) as excel_data: + table = excel_data.sheets()[0] + win32api.SetFileAttributes(filename,win32con.FILE_ATTRIBUTE_HIDDEN) except FileNotFoundError: msgbox.showerror('找不到数据库文件', '在相同目录下未能找到 names.xls 文件,请确认您的文件存在') sys.exit()