![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
python
NULL1l
这个作者很懒,什么都没留下…
展开
-
a bytes-like object is required, not ‘str‘
python3运行如下脚本时提示a bytes-like object is required, not 'str'错误import base64code = '''helloworld'''print(base64.b64encode(code))报错信息如下:Traceback (most recent call last): File "/Users/lmc/python/awd/abc.py", line 13, in <module> print(base原创 2021-06-08 19:14:21 · 909 阅读 · 0 评论 -
python 2.x 和 python 3.x 的比较
python入门之python 2.x 和 python 3.x 的比较 1. 编码方式2. print语句3. 除法运算4. 八进制表示5. 比较行为6. 整数类型7. 关键字8. input()函数。9. range()函数。10. 异常1. 编码方式python 3.x 默认采用UTF-8编码,对中英文都有很好的支持,python 2.x 默认采用ASCII编码,对中文支持不够良好,为了防止因程序包含中文而报错,一般在python 2.x 文件首行将编码格式设置为UTF-8,设置方式如下:# -原创 2020-11-05 10:15:08 · 943 阅读 · 0 评论