In [4]:
import pickle
from collections import namedtuple
In [5]:
Student = namedtuple('Student','name id gpa')
In [8]:
dean = Student('Dean',1,4.0)
print (dean)
Student(name='Dean', id=1, gpa=4.0)
In [10]:
with open ('student.pkl','wb') as f:
    pickle.dump(dean,f)


Comments

comments powered by Disqus