the usage of pickle

Dino Hsu dino1_nospam at ms1.hinet.net
Fri Aug 10 05:51:10 EDT 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 ?
    pickle.dump(f,'test.txt')
  File "c:\python21\lib\pickle.py", line 939, in dump
    Pickler(file, bin).dump(object)
  File "c:\python21\lib\pickle.py", line 104, in __init__
    self.write = file.write
AttributeError: write

Dino




More information about the Python-list mailing list