标签:write read pen japan int utf-8 pytho coding content
操作文件
# coding=utf-8 支持中文
"""
China
Japan
France
England
"""
f = open("record.txt", "a+") # 读写追加
content = f.readline()
print content
content = f.readlines()
print content
f.write('\nGerman')
f.close()
"""
China
Japan
France
England
German
"""
逐行读
# coding=utf-8 支持中文
f = open("record.txt", "r+")
content = f.readline()
while content:
print content
content = f.readline()
f.close()
标签:write read pen japan int utf-8 pytho coding content
原文地址:https://www.cnblogs.com/jiqing9006/p/10591529.html