Skip to content

Instantly share code, notes, and snippets.

@stober
Created May 2, 2012 19:47
Show Gist options
  • Save stober/2579720 to your computer and use it in GitHub Desktop.
Save stober/2579720 to your computer and use it in GitHub Desktop.
Generator for Multiple Pickle Loads
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