020_with
#!/usr/bin/env python
# Author:liujun
with open("test","r",encoding="utf-8") as f:
for line in f:
print(line.strip())
with open("test","r",encoding="utf-8") as f,open("test.bak","w",encoding="utf-8") as f_new:
for line in f:
f_new.write(line.upper())
posted on 2018-09-05 20:13 langjitianyadaolao 阅读(83) 评论(0) 编辑 收藏 举报