Last active
August 23, 2022 06:38
-
-
Save jonnyyu/7f01b632e3b6325a821f8c0124e31fa8 to your computer and use it in GitHub Desktop.
json_utils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def read_json(json_file): | |
with open(json_file, 'r', encoding='utf-8') as fi: | |
return json.load(fi) | |
def write_json(obj, json_file): | |
with open(json_file, 'w', encoding='utf-8') as fo: | |
json.dump(obj, fo) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment