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

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

原因:

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

 

 

 

posted @ 2021-08-29 10:46  苟住,别浪  阅读(156)  评论(0)    收藏  举报