导入导出功能自动化,对象txt格式导入导出,策略txt和json格式导入,txt格式导出

This commit is contained in:
hebingning
2020-12-24 20:02:22 +08:00
parent 2443be3579
commit b11b2a654d
4 changed files with 836 additions and 86 deletions

View File

@@ -0,0 +1,26 @@
def CountLines(fname):
count = 0
with open(fname, 'rb') as f:
for file_line in f:
file_line = file_line.strip()
# print(file_line)
# 空行
if file_line == b'':
pass
# 注释 # 开头
elif file_line.startswith(b'-->'):
pass
# 代码
else:
count += 1
print(fname + '----', count)
# 单个文件行数
# print(fname,'----count:',count)
return count
def WriteBinary(response,path1):
with open(path1,"wb") as f2:
strb = response
f2.write(strb)