Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- class Character(object):
- """Crude example."""
- me = Character()
- me.name = "God"
- me.stats = [1, 2, 3, 4, 5]
- import pickle
- pickle.dump(me, file("me.character", "w"))
- del me
- me = pickle.load(file("me.character", "r"))
- print(me.name)
- print(me.stats)
- # Prints:
- # God
- # [1, 2, 3, 4, 5]
Add Comment
Please, Sign In to add comment