Browse Source

Json

pull/3/head
Jure Šorn 7 years ago
parent
commit
fbc711210e
1 changed files with 6 additions and 4 deletions
  1. 10
      README.md

10
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(<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

Loading…
Cancel
Save