use_pickle.py 180 B

1234567891011
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import pickle
  4. d = dict(name='Bob', age=20, score=88)
  5. data = pickle.dumps(d)
  6. print(data)
  7. reborn = pickle.loads(data)
  8. print(reborn)