标签:strip() utf-8 lin style env upper pytho write for
#!/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())
标签:strip() utf-8 lin style env upper pytho write for
原文地址:https://www.cnblogs.com/liujun5319/p/9594199.html