finished serializing.html

This commit is contained in:
Mark Pilgrim
2009-08-19 02:23:15 -04:00
parent 2050232473
commit 24020a5f8c
4 changed files with 128 additions and 82 deletions
+4 -4
View File
@@ -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']))