運行程序時出現下面的錯誤:
TypeError: write() argument must be str, not bytes
其實是文件打開的問題,而且默認的儲存方式是二進制
原始程序是:
with open(result_file, 'w') as f:
將其改成下面的就對了
with open(result_file, 'wb+') as f:
運行程序時出現下面的錯誤:
TypeError: write() argument must be str, not bytes
原始程序是:
with open(result_file, 'w') as f:
將其改成下面的就對了
with open(result_file, 'wb+') as f:
讓您你們失望了,我啥都沒寫。 提供鏈接 https://blog.csdn.net/weixin_30832351/article/details/94889557