Created
May 18, 2017 15:00
-
-
Save Everfighting/b038c291c8ac66deac2861ab58538dd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> import pickle | |
| >>> f = open('somedata', 'wb') | |
| >>> pickle.dump([1, 2, 3, 4], f) | |
| >>> pickle.dump('hello', f) | |
| >>> pickle.dump({'Apple', 'Pear', 'Banana'}, f) | |
| >>> f.close() | |
| >>> f = open('somedata', 'rb') | |
| >>> pickle.load(f) | |
| [1, 2, 3, 4] | |
| >>> pickle.load(f) | |
| 'hello' | |
| >>> pickle.load(f) | |
| {'Apple', 'Pear', 'Banana'} | |
| >>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment