[Tutor] cPickle usage
Pierre Barbier de Reuille
pierre.barbier at cirad.fr
Thu Aug 25 15:20:16 CEST 2005
Jorge Louis de Castro a écrit :
> Hi,
>
> [Sorry for the repost, there was a typo previously]
>
> I think I may have misinterpreted the syntax of cPickle. I have dumped data
> onto a file using:
>
> [...]
>
> I thought I could unpickle this using the load feature, something like:
> inFile = codecs.open(".\\"+self.filename, "r")
> cPickle.load(self.terms, inFile)
> cPickle.load(self.username, inFile)
> cPickle.load(self.age, inFile)
> cPickle.load(self.gender, inFile)
> cPickle.load(self.totalMsgs, inFile)
> cPickle.load(self.occurrences, inFile)
self.terms = cPickle.load(inFile)
self.username = cPickle.load(inFile)
...
should work better :)
>
> Which would unpickle the data onto the variables. It does not work like
> that, unfortunately. When I try reading the whole file I only get the first
> object read as output.
> Any ideas how to achieve what this?
>
> chrs
> j.
>
--
Pierre Barbier de Reuille
INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP
Botanique et Bio-informatique de l'Architecture des Plantes
TA40/PSII, Boulevard de la Lironde
34398 MONTPELLIER CEDEX 5, France
tel : (33) 4 67 61 65 77 fax : (33) 4 67 61 56 68
More information about the Tutor
mailing list