python覆蓋寫入,追加寫入

追加寫入:spa   # -*- coding:utf-8 -*-utf-8 # a 指定打開文件的模式,a爲追加   r爲只讀it a=open('test.txt', 'a')test a.write('追加寫入')coding a.close()di   f=open('test.txt', 'r')文件 print f.read()co   覆蓋寫入:   a=open('test.txt
相關文章
相關標籤/搜索