小改动、回档

This commit is contained in:
bgArray
2022-01-28 18:29:51 +08:00
parent 26ee16f071
commit 19bbb92cff
31 changed files with 285 additions and 29 deletions

View File

@@ -1,27 +1,25 @@
# -*- conding: utf8 -*-
import os
import os
from msctspt.funcOpera import keepart
m = 0
l = 0
for path,dir_list,file_list in os.walk(r"./") :
for file_name in file_list:
if keepart(file_name,'.',None) == '.py':
for path, dir_list, file_list in os.walk(r"./"):
for file_name in file_list:
if keepart(file_name, '.', None) == '.py':
file = os.path.join(path, file_name)
print("得到文件名:"+str(file))
for i in open(file,'r',encoding="utf-8"):
code = i.replace(' ','').replace('\n','')
print("得到文件名:" + str(file))
for i in open(file, 'r', encoding="utf-8"):
code = i.replace(' ', '').replace('\n', '')
try:
code -= code[code.index('#'):]
except:
pass
if code:
print("\t"+code)
l+=1
print("\t" + code)
m += 1
else:
pass
input("\n最终代码行数为:"+str(l))
input("\n最终代码行数为:" + str(m))