Skip to content

Commit 1fe781b

Browse files
优化:区分py/pyw计数(Issues #37)
1 parent daa3115 commit 1fe781b

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

SECURITY.md

+3
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@
4747
#Issues36: tag:新功能,优化,需要社区帮助
4848
#建议添加更新程序
4949
#描述:在版本信息检测工具检测到新版本后调用更新程序
50+
51+
#Issues37: tag:优化,处理中->待发布
52+
#[实验性]自动打包所有py文件工具可以区分具体找到了多少个py文件与多少个pyw文件
5053
-->

Tools/【实验性工具】/自动化/自动打包所有py文件/Pyinstaller.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
fail = 0
88
conutf = 0
99
aconut = 0
10+
pyw_aconut = 0
11+
py_acount = 0
1012

1113
# 文件夹路径
1214
print("以下所有路径请不要带引号!")
@@ -18,11 +20,17 @@
1820

1921
for root, dirs, files in os.walk(folder_path):
2022
for file in files:
21-
if file.endswith('.py') or file.endswith('.pyw'):
23+
if file.endswith('.py'):
24+
file_path = os.path.join(root, file)
25+
print(Fore.BLUE + f'Found py file: {file_path}')
26+
py_acount = py_acount + 1
27+
elif file.endswith('.pyw'):
2228
file_path = os.path.join(root, file)
23-
print(Fore.BLUE + f'Found file: {file_path}')
24-
aconut = aconut + 1
25-
print(f"一共找到了{aconut}个py/pyw文件。")
29+
print(Fore.BLUE + f'Found pyw file: {file_path}')
30+
pyw_aconut = pyw_aconut + 1
31+
32+
aconut = py_acount + pyw_aconut
33+
print(f"一共找到了{aconut}个py/pyw文件。\n其中有{py_acount}个py文件/{pyw_aconut}个pyw文件。")
2634

2735
# 函数:记录日志并添加分隔线
2836
def log_message(message, log_file, success=True):

0 commit comments

Comments
 (0)