陳雨彤檔案處理

 

utf8 encoding編碼

練習程式碼

f = open("ascii.txt", "r+", encoding='utf8')
x = f.read()
print(x)
f.write("\n陳雨彤") #寫入字串
f.close() #陳雨彤關閉檔案r+讀增加append
print('f長度',len(x))
for i in x: #用迴圈印出每一個字元
    print(i)

影片377

影片378

留言

這個網誌中的熱門文章

陳雨彤[串列list](元組tuple){集合set}{字典:dict}