Added first EVI 2018 files.
This commit is contained in:
16
EVI - 2018/EVI 04/Ejemplos/jsoning.py
Normal file
16
EVI - 2018/EVI 04/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