Python Pickle throwing EOFError -
already_done = ['lol', 'lol2'] already_done = pickle.load( open( "save.p", "rb" ) ) that little snippet of code throws eoferror pickle, no matter if save.p exists or not. suggestions?
i not why expect code snippet work, it's failing because you're not understanding how pickle works. way of example:
>>> s = (1,2,3) >>> pickle.dump(s, open('save.p', 'wb')) >>> s2 = pickle.load(open('save.p', 'b')) >>> s2 (1, 2, 3) you have write out using pickle module before can reload it.
Comments
Post a Comment