对所使用的字符串类型调用encode()方法进行转换即可
相关文章
- Python入门之TypeError: 'str' object is not callable错误
- TypeError: a bytes-like object is required, not 'str'
- python中读取json文件报错,TypeError:the Json object must be str, bytes or bytearray,not ‘TextIOWrapper’
- 【待解决】python写文件时报错:TypeError: a bytes-like object is required, not 'str'
- Python BeautifulSoup [解决方法] TypeError: list indices must be integers or slices, not str
- python问题:TypeError: a bytes-like object is required, not 'str'
- TypeError: a bytes-like object is required, not 'str'
- python 3.5: TypeError: a bytes-like object is required, not 'str'
- python3 TypeError: a bytes-like object is required, not 'str'
- Python 出现错误TypeError: ‘NoneType’ object is not iterable解决办法