mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
finished serializing.html
This commit is contained in:
@@ -38,11 +38,11 @@ if __name__ == '__main__':
|
||||
print(type(entry['tags']))
|
||||
print(type(entry2['tags']))
|
||||
|
||||
with open('entry.json', 'w', encoding = 'utf-8') as f:
|
||||
json.dump(entry, f, default = to_json)
|
||||
with open('entry.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(entry, f, default=to_json)
|
||||
|
||||
with open('entry.json', 'r', encoding = 'utf-8') as f:
|
||||
entry2 = json.load(f, object_hook = from_json)
|
||||
with open('entry.json', 'r', encoding='utf-8') as f:
|
||||
entry2 = json.load(f, object_hook=from_json)
|
||||
|
||||
print(entry == entry2)
|
||||
print(type(entry['tags']))
|
||||
|
||||
Reference in New Issue
Block a user