Published: May 24, 2017
import json a = {'hello': 'world'} b = 'mohit' with open('C:\\Users\\mohit\\temp\\filename.json', 'wt') as handle: json.dump(a, handle)