How to store numeric array in disk

Tawee Laoitichote astpspd at pea.or.th
Fri Apr 27 04:43:15 EDT 2001


Dear,

I'd like to keep my array stuff in my hard disk after a number of
experiments. I hear of pickling and unpickling. I have tried but some
errors. Like this :

py> myfile='h:\\python21\\prob.pik'
py> print myfile
h:\python21\prob.pik
py> p=pickle.Pickler(myfile)
Traceback (most recent call last):
  File "<pyshell#61>", line 1, in ?
    p=pickle.Pickler(myfile)
  File "h:\python21\lib\pickle.py", line 104, in __init__
    self.write = file.write
AttributeError: write

my next statement should be p.dump(mystuff) #which is my array stuff

What am I doing wrong? Please suggest...





More information about the Python-list mailing list