#json 和对象互转
import json
class Student:
def __init__(self):
self.Name=""
self.Age=15
self.Sex="男"
self.Email="abc@163.com"
self.Address="abdcessssssssssssssssss"
student=Student()
studentDict=student.__dict__
print(studentDict)
studentJson=json.dumps(studentDict)
print(studentJson)
studentNewDict=json.loads(studentJson)
newstudent=Student()
newstudent.__dict__=studentNewDict
print(newstudent.Address)