Added files for Ecoanova's Python 3 course.
This commit is contained in:
16
Ecoanova/Introduccion a Python 3/Ejemplos/jsoning.py
Normal file
16
Ecoanova/Introduccion a Python 3/Ejemplos/jsoning.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import json
|
||||
|
||||
data = {"Name": "Miguel",
|
||||
"Age": 27,
|
||||
"ID": 18810993,
|
||||
"info" : {"Height": 1.72,
|
||||
"Weight": 80
|
||||
}
|
||||
}
|
||||
|
||||
with open("data.json", "w") as f:
|
||||
f.write(json.dumps(data))
|
||||
|
||||
with open("example.json") as f:
|
||||
j = json.loads(f.read())
|
||||
print(j["isAlive"])
|
Reference in New Issue
Block a user