会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
leon-chan
博客园
首页
新随笔
联系
管理
订阅
2019年7月30日
记-python中TypeError: a bytes-like object is required, not 'str'和TypeError: must be str, not bytes with sys.stdout.write()
摘要: 在python中跟其他语言一样,有的情景参数需要传递字符串,有的情景参数需要二进制bytes,转换他们之间的关系需要用到 1、转换为二进制bytes需要用到的是encode('utf-8'),用法为:str.encode('utf-8') 2、转化为字符串需要用到decode('utf-8'),用法
阅读全文
posted @ 2019-07-30 09:02 leon-chan
阅读(363)
评论(0)
推荐(0)
公告