批量读取txt文件长度并写入新文件
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
filePath = 'test/'
fileType = 'txt'
fileLists = os.listdir(filePath)
file = open('lenList.txt','w')
for txt in fileLists:
total_num = len(fileLists)
with open(filePath+txt, 'r') as f:
.
原创
2022-01-18 12:53:29 ·
751 阅读 ·
0 评论