空格去

import os

a = []
with open("pp.txt","r+",encoding="utf8") as file:
for line in file.readlines():
a.append(line.strip("\n"))

print(a)

b = ""
for item in a:
b+= item+" "

print(b)
posted @ 2019-05-21 10:41  雷神约  阅读(121)  评论(0编辑  收藏  举报