文件 IO

# 写文件
with open("byh.txt","wt") as out_flie:
out_flie.write("121431\n414")
with open("byh.txt","rt") as in_file:
text = in_file.read()
print(text)

输出结果:

121431
414

猜你喜欢

转载自www.cnblogs.com/byh7595/p/11959276.html