[英]PyCharm does not display Cyrillic
import json
file =
r'C:\Programming\python_django\store\products\fixtures\category.json'
file_2 =
r'C:\Programming\python_django\store\products\fixtures\category.json'
with open(file, 'rb') as open_file:
data = json.load(open_file)
with open(file_2, 'w') as write_file:
write_file.write(json.dumps(data, ensure_ascii=False,
indent=0,
separators=(',', ':
')).encode('cp866').decode('cp1251'))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.