Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Python 3.4.1 (default, May 21 2014, 12:39:51)
  2. [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> mylist = ['I wish to complain about this parrot what I purchased not half an hour ago from this very boutique.', "Oh yes, the, uh, the Norwegian Blue...What's,uh...What's wrong with it?", "I'll tell you what's wrong with it, my lad. 'E's dead, that's what's wrong with it!", "No, no, 'e's uh,...he's resting."]
  5. >>>
  6. >>> import pickle
  7. >>>
  8. >>> with open('parrot.pkl', 'wb') as f:
  9. ... pickle.dump(mylist, f)
  10. ...
  11. >>>
  12.  
  13. Python 3.4.1 (default, May 21 2014, 12:39:51)
  14. [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
  15. Type "help", "copyright", "credits" or "license" for more information.
  16. >>> import pickle
  17. >>> with open('parrot.pkl', 'rb') as f:
  18. ... mynewlist = pickle.load(f)
  19. ...
  20. >>> mynewlist
  21. ['I wish to complain about this parrot what I purchased not half an hour ago from this very boutique.', "Oh yes, the, uh, the Norwegian Blue...What's,uh...What's wrong with it?", "I'll tell you what's wrong with it, my lad. 'E's dead, that's what's wrong with it!", "No, no, 'e's uh,...he's resting."]
  22. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement