#写文件
with open("E:/hyx/test.txt","wt") as out_file:
out_file.write("Hello,world!")
#读文件
with open("E:/hyx/test.txt","rt") as in_file:
text = in_file.read()
print(text)
python3实例(七)IO读写文件
最新推荐文章于 2021-02-03 06:58:22 发布
#写文件
with open("E:/hyx/test.txt","wt") as out_file:
out_file.write("Hello,world!")
#读文件
with open("E:/hyx/test.txt","rt") as in_file:
text = in_file.read()
print(text)