标签:file ike href targe typeerror err encode bytes 设置
file = open(filename, ‘r‘, encoding=‘UTF-8‘)
str = str.encode()
参考:https://www.fujieace.com/python/str-bytes.html
python读文件,TypeError: a bytes-like object is required, not 'str'
标签:file ike href targe typeerror err encode bytes 设置
原文地址:https://www.cnblogs.com/sybil-hxl/p/13237078.html