xlrd and cPickle.dump/rows to list

patrick.waldo at gmail.com patrick.waldo at gmail.com
Mon Mar 31 14:52:18 EDT 2008


Hi all,

I have to work with a very large excel file and I have two questions.

First, the documentation says that cPickle.dump would be the best way
to work with it.  However, I keep getting:
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\python_files\pickle_test.py", line 12, in ?
    cPickle.dump(book,wb.save(pickle_path))
  File "C:\Python24\lib\copy_reg.py", line 69, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle file objects

I tried to use open(filename, 'w') as well as pyExcelerator
(wb.save(pickle_path)) to create the pickle file, but neither worked.

Any ideas would be much appreciated.

Patrick



More information about the Python-list mailing list