the usage of pickle

Dino Hsu dino1_nospam at
Fri Aug 10 11:51:10 CEST 2001

Dear all,

When I try pickle.dump(...), it always fails, anyone show me how?
Thanks in advance.

>>> def f():
	return '123456'
>>> f
<function f at 01215F2C>

>>> pickle.dump(f,'test.txt')
Traceback (most recent call last):
  File "<pyshell#60>", line 1, in ?
  File "c:\python21\lib\", line 939, in dump
    Pickler(file, bin).dump(object)
  File "c:\python21\lib\", line 104, in __init__
    self.write = file.write
AttributeError: write


More information about the Python-list mailing list