劉任昌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>

留言

  1. https://kevin124574811.blogspot.com/2024/03/python.html

    回覆刪除
  2. https://the-dumbest-one.blogspot.com/2024/03/pythonfilemethods.html

    回覆刪除
  3. https://fanyahui.blogspot.com/2024/03/pythonfilemethods.html

    回覆刪除
  4. https://sushshshaq119.blogspot.com/2024/03/python-utf-8.html

    回覆刪除
  5. https://ruubyy0.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  6. https://hsiao-yu0711.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  7. https://xi-xbox-mmi.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  8. https://meimei20041026.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  9. https://yrye4312311.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  10. https://huilii.blogspot.com/2024/03/pythonfilemethods.html

    回覆刪除
  11. https://ccp19890604.blogspot.com/2024/03/pythonfilemethods.html

    回覆刪除
  12. https://euhffh822.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  13. https://draft.blogger.com/blog/post/edit/preview/5323466090213672846/1804356091528444940

    回覆刪除
  14. https://www.blogger.com/blog/post/edit/preview/141866742300809757/1752973703357840031

    回覆刪除
  15. https://www.blogger.com/blog/post/edit/preview/9181995951046717335/5984922080644890556

    回覆刪除
  16. https://xuangreat.blogspot.com/2024/03/utf8-encoding-f-openascii.html

    回覆刪除
  17. https://the-most-beeaut.blogspot.com/2024/03/pythonfilemethods.html

    回覆刪除
  18. https://s10655075.blogspot.com/2024/03/pythonutf8.html

    回覆刪除
  19. https://honghikun.blogspot.com/2024/03/pythonutf8.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

劉任昌大語言模型協助收集簡報的資料

劉任昌w3schools學習ASCII, Emoji與Javascript迴圈

劉任昌HTML,CSS,樣式style,嵌入iframe