鄭富哲python檔案方法utf8

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

ascii art字元藝術

上面的原始碼,拷貝下面的code在html模式貼上就可以 
<iframe src="https://en.wikipedia.org/wiki/ASCII_art" height=400 width=100%></iframe>

留言

這個網誌中的熱門文章

金三甲期末考重要題庫與額未加分作業

鄭富哲python內建built-in函數function迴圈loop範圍range

鄭富哲LEFT,MID,RIGHT,LEN,IF