会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
流夏
博客园
首页
新随笔
管理
2019年11月23日
python按行读取文件
摘要: ·读 1 2 3 4 file = open("sample.txt") for line in file: pass # do something file.close() 去除换行符 1 2 3 for line in file.readlines(): line=line.strip('\n'
阅读全文
posted @ 2019-11-23 17:37 流年的夏天
阅读(4845)
评论(0)
推荐(1)
公告