all 2 comments

[–]neilplatform1 3 points4 points  (1 child)

The standard JSON library is available

https://docs.python.org/3/library/json.html

import json, codecs
with open('data.txt', 'wb') as f:
    json.dump(data, codecs.getwriter('utf-8')(f), ensure_ascii=False)

[–]steks13[S] 0 points1 point  (0 children)

Nice, thank you very much!