[python-win32] speed up win32com.client
Mark Hammond
mhammond at skippinet.com.au
Sun May 13 04:35:17 CEST 2012
On 13/05/2012 5:00 AM, DANIEL POSE wrote:
> I had tried to change attribute name in several ways (InsertionPoint,
> insertionPoint, insertionpoint,...) but I obtained the same error:
>
> Traceback (most recent call last):
> File "<ipython console>", line 1, in <module>
> File
> "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\startup.py",
> line 128, in runfile
> execfile(filename, glbs)
> File "C:\Documents and Settings\Usuario\Mis
> documentos\Dropbox\PYTHON\PruebaAutoCAD.py", line 29, in <module>
> M.append(objeto.insertionpoint)
> File "C:\Python27\lib\site-packages\win32com\client\__init__.py",
> line 465, in __getattr__
> raise AttributeError("'%s' object has no attribute '%s'" %
> (repr(self), attr))
> AttributeError: '<win32com.gen_py.AutoCAD 2008 Type Library.IAcadEntity
> instance at 0x88940672>' object has no attribute 'insertionpoint'
In the gen_py directory you should find a generated file supporting the
AutoCAD object - it will have a GUID in its name so it might not be
obvious which one applies, but inside that you should find the
'IAcadEntity' object. That should have a _prop_map_get attribute which
lists the attributes available on the object - I'd expect to find
insertionPoint listed there. It may turn out it is actually on a
different object, in which case the win32com.client.CastTo() function
might be useful to get the appropriate interface.
> If I delete only the win32com\client\gen_py folder It doesn't work. I
> need delete for example win32com and win32 folders and restore older ones.
Hrm - I certainly can't explain that! Or maybe I can - check your
%TEMP% folder and see if there is a gen_py directory there?
Mark
More information about the python-win32
mailing list