python打开文件时去除换行符

with open('1.txt', 'r') as f:
my_list = f.read().splitlines() # 去除\n,生成list

posted on 2021-05-19 16:15  跨过⑦海D風  阅读(245)  评论(0编辑  收藏  举报

导航