diff --git a/README.md b/README.md index 0252ebf..428214f 100644 --- a/README.md +++ b/README.md @@ -444,14 +444,16 @@ import json ### Read File ```python -with open(filename, encoding='utf-8') as file: - return json.load(file) +def read_json_file(filename): + with open(filename, encoding='utf-8') as file: + return json.load(file) ``` ### Write to File ```python -with open(filename, 'w', encoding='utf-8') as file: - json.dump(, file, ensure_ascii=True, indent=None) +def write_to_json_file(filename, an_object): + with open(filename, 'w', encoding='utf-8') as file: + json.dump(an_object, file, ensure_ascii=True, indent=None) ``` SQLite