Linglun-Converter/自我陶醉.py

26 lines
678 B
Python
Raw Normal View History

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