python 追加写入文件

python 追加写入文件

如题。
将模式参数设置为"a"即可

with open("../output/scoresOfMyBayes.txt", "a") as sob:
    sob.write("The score of test "+str(i)+" is "+str(score)+'\n')
原创文章 327 获赞 212 访问量 40万+

猜你喜欢

转载自blog.csdn.net/swy_swy_swy/article/details/105851296