0
点赞
收藏
分享

微信扫一扫

python编码问题:UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 68: illeg

流沙雨帘 2022-05-20 阅读 66


import yaml
def test_yaml():
f = open('C:\hogwarts\Scripts\hogwarts-api\demo\yaml_data.yml')
print(yaml.load(f))  

# 改进:
import yaml
def test_yaml():
f = open('C:\hogwarts\Scripts\hogwarts-api\demo\yaml_data.yml','rb')
print(yaml.load(f))




举报

相关推荐

0 条评论