|
|
@ -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(<object>, 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 |
|
|
|