会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
明天OoO你好
博客园
首页
新随笔
联系
管理
2020年11月30日
python获取文件行数
摘要: count = 0 with open('/cm/com.file','rb') as f: while True: buffer = f.read(1024*8192) if not buffer: break count += buffer.count(b"\n") print(count)
阅读全文
posted @ 2020-11-30 22:29 明天OoO你好
阅读(1146)
评论(0)
推荐(0)