Skip to content

Instantly share code, notes, and snippets.

@keithweaver
keithweaver / save-file.py
Last active June 14, 2023 05:13
Save JSON file with Python
import json
def writeToJSONFile(path, fileName, data):
filePathNameWExt = './' + path + '/' + fileName + '.json'
with open(filePathNameWExt, 'w') as fp:
json.dump(data, fp)
# Example
data = {}