Created
May 2, 2012 19:47
-
-
Save stober/2579720 to your computer and use it in GitHub Desktop.
Generator for Multiple Pickle Loads
This file contains 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 | |
def loader(fp): | |
# a load iter | |
while True: | |
try: | |
yield pickle.load(fp) | |
except EOFError: | |
raise StopIteration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment