1import json
2with open('data.json', 'w') as f:
3 json.dump(data, f)
4On a modern system (i.e. Python 3 and UTF-8 support), you can write a nicer file with
5
6import json
7with open('data.json', 'w', encoding='utf-8') as f:
8 json.dump(data, f, ensure_ascii=False, indent=4)