From: Werner F. B. <wer...@fr...> - 2007-07-11 08:52:46
|
Hi, YeungXS67 wrote: > I frequently receive this error that insists an object is a 'str' object > and that it doesn't have an attribute 'data', although it most certainly > does. This error only occurs after it's been compiled and executed as an > executable, but not as a .py file executed through the interpreter. Does > anyone know why this is? > > Traceback (most recent call last): > File "pwcb.py", line 111, in <module> > File "pwcb.py", line 27, in begin_capture > AttributeError: 'str' object has no attribute 'data' When you package your app with py2exe there are some things which might not work quit the same way then when you run it from a python shell or the ide you use. E.g. if you load a file and expect the path to it to be the same then on your development machine it might not be there and I am sure there are many more examples. You are not giving enough information for anyone to help you find out what is the cause of the problem. You need to show at least the line 27 of your pwcb.py script, but better whould be the whole method and/or the code which calls the method. Werner |