在原来文本的基础上添加新的信息

text  = "新添加的内容"
my_file = open('my file.txt','a')
my_file.write(text)
my_file.close()

结果:

python简单读取文件案例二

相关文章: