[BangPypers] Pickle multiple objects

Sidharth Kuruvila sidharth.kuruvila at gmail.com
Wed Oct 7 10:40:15 CEST 2009


Oops formatting got mucked up. Should be

def pickledobjects(f):
    try:
        while True:
            yield pickle.load(f)
    except EOFError:
        pass

objs = list(pickledobjects(file("fi")))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20091007/6aa5e732/attachment.htm>


More information about the BangPypers mailing list