From 4d38b65df3c7fe6ff02d3d47fa90babc64755878 Mon Sep 17 00:00:00 2001 From: 13632530821 Date: Sat, 19 Nov 2022 17:40:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 34 +++------------------------------- 点名器.pyw | 6 +++--- 2 files changed, 6 insertions(+), 34 deletions(-) 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()