python 追加写入文件 如题。 将模式参数设置为"a"即可 with open("../output/scoresOfMyBayes.txt", "a") as sob: sob.write("The score of test "+str(i)+" is "+str(score)+'\n')