2024-05-02 00:29:21 +08:00
|
|
|
# -*- conding: utf8 -*-
|
2024-01-08 00:10:17 +08:00
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
m = 0
|
|
|
|
|
|
|
|
for path, dir_list, file_list in os.walk(r"./"):
|
2024-05-02 00:29:21 +08:00
|
|
|
if (r".venv" in path) or (r"wxFB_Project" in path):
|
|
|
|
continue
|
2024-01-08 00:10:17 +08:00
|
|
|
for file_name in file_list:
|
2024-05-02 00:29:21 +08:00
|
|
|
if file_name.endswith(".py"):
|
2024-01-08 00:10:17 +08:00
|
|
|
file = os.path.join(path, file_name)
|
|
|
|
print("得到文件名:" + str(file))
|
2024-05-02 00:29:21 +08:00
|
|
|
for i in open(file, "r", encoding="utf-8"):
|
2024-01-08 00:10:17 +08:00
|
|
|
code = i.strip()
|
2024-05-02 00:29:21 +08:00
|
|
|
|
|
|
|
if code.startswith("#"):
|
2024-01-08 00:10:17 +08:00
|
|
|
pass
|
|
|
|
elif code:
|
|
|
|
print("\t" + code)
|
|
|
|
m += 1
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
|
|
|
|
input("\n最终代码行数为:" + str(m))
|