python3 stock send() 函数报错: TypeError: a bytes-like object is required, not 'str'

时间:2021-08-30 09:05:24   收藏:0   阅读:5

python3 stock send() 函数报错: TypeError: a bytes-like object is required, not ‘str‘

原因:

python2 send() 函数接收的参数类型是 str,而 python3 send() 函数接收的数据类型是 bytes,所以在 python3 中需要将 send() 的入参使用 encode() 进行转化

 

 

技术分享图片

 

原文:https://www.cnblogs.com/gxfaxe/p/15202067.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!