YAML 对中文的处理

 

from yaml import load,dump

f = open('xx.ymal',encoding='utf-8')

l = load(f)

print(f)

 

 

 

w = open('xx_copy.ymal','w',wencoding = 'utf-8')

dump(l,w,allow_unicode = True)

 

posted @ 2017-09-07 23:34  痴道三  阅读(4479)  评论(0编辑  收藏  举报