import os
bash_dir = os.path.dirname(__file__)
bash_path = os.path.join(bash_dir, "modules")
counts = 0
def count_row(path):
if os.path.isdir(path):
for p in os.listdir(path):
count_row(os.path.join(path, p))
else:
if path.endswith(".py"):
with open(path, encoding="utf-8") as f:
global counts
counts += len(f.readlines())
count_row(bash_path)
print(counts)
统计代码量
最新推荐文章于 2025-03-26 11:05:00 发布