Mark> def saveOjb(self, dataObj): Mark> fName = self.version + '_' + self.modname + '.dat' Mark> f = open(fName, 'w') Mark> dStr = pickle.dumps(dataObj) Mark> c = dStr.encode("bz2") Mark> pickle.dump(c, f, pickle.HIGHEST_PROTOCOL) Mark> f.close()
Hmmm... Why pickle it twice? def saveOjb(self, dataObj): fName = self.version + '_' + self.modname + '.dat' f = open(fName, 'wb') f.write(pickle.dumps(dataObj, pickle.HIGHEST_PROTOCOL).encode("bz2")) f.close() Skip -- http://mail.python.org/mailman/listinfo/python-list