So, i've been pickling multiple data to the same pickle file with this type of code:
for i in range(0, x):
with open('file', 'ab') as f:
pickle.dump(data, f)
As far everything works fine. You can read this using:
data = []
with open('file', 'rb') as f:
while True:
try:
data.extend(pickle.load(f))
except:
break
The problem is that if i re-run the first part of code I can only access what was written to the file the first time. I suppose it may have something to do with EOF, but this really shouldn't be the case if we are opening file in 'append' mode. The pickle documentation is also beyond useless. My question is how to read from pickled file if it was appended to from multiple scripts?