python binary mode doesn take an encoding argument

rmlText = b"fdsfas"
open(rml_file_name,"wb",encoding="utf-8").write(rmlText)

報錯

binary mode doesn't take an encoding argument

 

寫二進制文件時 不指定 encoding

 

rmlText = b"fdsfas"
open(rml_file_name,"wb").write(rmlText)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章