How to pickle several .txt files into one pickle
问题 I need to overcome some cPickle constrains, namely i need to open several files and pickle them to one file, like this: import cPickle file1=open('file1.txt','r') file2=open('file2.txt','r') obj=[file1,file2] or obj=[file1.read(), file2.read()] cPickle.dump(obj,open('result.i2','w'),2) so that later I can "repickle" them and get the data. Is a cPickle good way to do so?If yes how can I do it properly If not, what would be suitable? Thanks in advance Rafal 回答1: This is the correct way, it