use*_*402 4 python text
我目前正在编写一些需要我记录结果的代码。但是,目前,我使用的代码只是覆盖了文档,而不是添加。我可以写什么来在文本文档的末尾添加一些东西?
ch3*_*3ka 5
打开文件 append mode
append mode
open(filename, 'a')
Doo*_*nob 5
只需使用附加模式:
with open('something.txt', 'a') as f: f.write('text to be appended')
可以在此处找到文档。
归档时间:
11 年,2 月 前
查看次数:
13651 次
最近记录: