准备尝试新事物

This commit is contained in:
2024-01-08 00:10:17 +08:00
parent eaefb6f987
commit 264d1ec11c
5 changed files with 103 additions and 25 deletions

23
自我陶醉.py Normal file
View File

@ -0,0 +1,23 @@
# -*- conding: utf8 -*-
import os
m = 0
for path, dir_list, file_list in os.walk(r"./"):
for file_name in file_list:
if file_name.endswith('.py'):
file = os.path.join(path, file_name)
print("得到文件名:" + str(file))
for i in open(file, 'r', encoding="utf-8"):
code = i.strip()
if code.startswith('#'):
pass
elif code:
print("\t" + code)
m += 1
else:
pass
input("\n最终代码行数为:" + str(m))