[Tutor] Pickle Module

Michael Janssen Janssen@rz.uni-frankfurt.de
Wed Jan 29 11:53:02 2003


On Wed, 29 Jan 2003, Deirdre Hackett wrote:

> pickle.dump(data,f)
>
> I want to write data to the file testing3.txt.

you have done it already. Perhaps you need to close the file again in
order to write cached data to disk (f.close()) or do this directly via
f.flush()

To read the data, you need another file-object in read-mode:

f = open("testing3.txt","r")

data = pickle.load(f)

Michael