api.LastJson
with open ('answer0.json', 'w') as f:
json.dump(directShareResult, f, indent=2, ensure_ascii=False)
----------
Traceback (most recent call last):
File "E:/I_API_W.py", line 284, in <module>
json.dump(directShareResult, f, indent=2, ensure_ascii=False)
File "C:\Python36\lib\json\__init__.py", line 180, in dump
fp.write(chunk)
File "C:\Python36\lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2764' in position 6: character maps to <undefined>
попробуй открыть файл в utf-8
open('sdvsdv.json', 'w', encoding='utf-8')
Обсуждают сегодня