如何附加到文件而不是覆盖它?是否有附加到文件的特殊功能?
python file append
with open("games.txt", "w") as text_file: print(driver.current_url) text_file.write(driver.current_url + "\n")
我现在正在使用此代码,但是当它写入文件时,它会覆盖旧内容.如何在不删除已经存在的内容的情况下简单地添加它.
python
python ×2
append ×1
file ×1