f = open("ascii.txt", "r+",encoding='utf8')
print(f.read)
f.close()
x = "張心姿"
f = open("ascii.txt", "r+",encoding='utf8')
y = f.write(x)
print(y)
print("名稱",f.name)
print("模式",f.mode)
print("關閉",f.closed)
line = f.read() #讀取檔案f成為字串
f.seek(len(line))
f.write('張心姿')
print('檔案字串長度',len(line))
print("檔案內容",line)
f.close()

`

留言

  1. 大老闆博士論文由小助理操刀的疑似案例 https://www.peopo.org/news/651341

    回覆刪除

張貼留言

這個網誌中的熱門文章

張心姿{集合SET}[串列LIST](元組TUPLE){字典:DICT和集合一樣但key所以:冒號value值}

張心姿keyevents期中考

張心姿產業分析HTML,CSS,JAVASCRIPT