with open('./activity.sql', 'r') as fp:
for line in fp:
line = line.strip('\n')
print line
# do something
Python 按行读取文件并去掉换行
最新推荐文章于 2024-10-23 09:58:58 发布
with open('./activity.sql', 'r') as fp:
for line in fp:
line = line.strip('\n')
print line
# do something