python TypeError: must be str, not bytes錯誤

1 TypeError: must be str, not bytes錯誤:
2 
3 解答: 
4  寫文件處 f=open(filename, 'w')應該寫爲 open(filename, 'wb')
5  讀文件時 f=open(filename,'rb')
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: illegal multibyte sequence解決方法同上
相關文章
相關標籤/搜索