problems using pickle in a py2exe created executable

Bob Kircher bob at kontact.com
Mon May 6 23:03:42 EDT 2002


I recently converted a python 2.1 (actually a pythonwin) program to a
standalone executable using py2exe

everything runs fine until I try to save my EmailXT dictionary
structure to a file using pickle. Here's the python code:

   import pickle 
   f=open('c:\\EmailXT.txt',"w+") 
   pickle.dump(EmailXT,f)
   f.close()

When I run the .exe file from the DOS prompt everything runs fine up
to the pickle statement then I get the following:

   Traceback (most recent call last):
     File "<string>", line 127, in ?
   NameError: name 'pickle' is not defined

I tried using cPickle and still got the same results.  Any ideas?

Thanks

Bob

bob at kontact.com



More information about the Python-list mailing list