From 5308fb97e8dc90da3c774889415bc6934d5b3781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 26 Mar 2018 16:49:22 +0200 Subject: [PATCH] Added JSON serialize --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab7fd55..5e83728 100644 --- a/README.md +++ b/README.md @@ -429,6 +429,12 @@ JSON import json ``` +### Serialize/Deserialize +```python + = json.dumps() + = json.loads() +``` + ### Read File ```python with open(filename, encoding='utf-8') as file: @@ -438,7 +444,7 @@ with open(filename, encoding='utf-8') as file: ### Write to File ```python with open(filename, 'w', encoding='utf-8') as file: - json.dump(, file) # Or: file.write(json.dumps()) + json.dump(, file) ``` SQLite