win32com problem

cfriedalek at gmail.com cfriedalek at gmail.com
Wed Oct 25 09:22:04 CEST 2006


Gabriel Genellina wrote:
> Run it on the debugger step by step, and inspect all the intermediate objects.
> Synergy.StudyDoc might be a function, by example, so you should add
> another pair of ().
> This is not obvious looking at the VB code.

(Sorry, tied up this arvo so I could respond to your suggestion
earlier.)

Here's part of a debug session.

(Pdb) type(Synergy.StudyDoc)
<type 'instance'>

(Pdb) type(Synergy.StudyDoc.GetFirstTet)
<type 'instance'>

(Pdb) Synergy.StudyDoc.GetFirstTet
<COMObject <unknown>>

(Pdb) dir (Synergy.StudyDoc)
['_ApplyTypes_', '_FlagAsMethod', '_LazyAddAttr_', '_NewEnum',
'_Release_', '__A
ttrToID__', '__LazyMap__', '__call__', '__cmp__', '__doc__',
'__getattr__', '__g
etitem__', '__init__', '__int__', '__len__', '__module__',
'__nonzero__', '__rep
r__', '__setattr__', '__setitem__', '__str__', '_builtMethods_',
'_enum_', '_fin
d_dispatch_type_', '_get_good_object_', '_get_good_single_object_',
'_lazydata_'
, '_make_method_', '_mapCachedItems_', '_oleobj_', '_olerepr_',
'_print_details_
', '_proc_', '_unicode_to_string_', '_username_', '_wrap_dispatch_']

(Pdb) dir (Synergy.StudyDoc.GetFirstTet)
['_ApplyTypes_', '_FlagAsMethod', '_LazyAddAttr_', '_NewEnum',
'_Release_', '__A
ttrToID__', '__LazyMap__', '__call__', '__cmp__', '__doc__',
'__getattr__', '__g
etitem__', '__init__', '__int__', '__len__', '__module__',
'__nonzero__', '__rep
r__', '__setattr__', '__setitem__', '__str__', '_builtMethods_',
'_enum_', '_fin
d_dispatch_type_', '_get_good_object_', '_get_good_single_object_',
'_lazydata_'
, '_make_method_', '_mapCachedItems_', '_oleobj_', '_olerepr_',
'_print_details_
', '_proc_', '_unicode_to_string_', '_username_', '_wrap_dispatch_']

I'm pretty green with this kind of introspection (but willing to dig in
and learn). With the VBS code seems like GetFirstTet is a method of
StudyDoc that returns a variable which converted to string yields "TE1"
 etc. But that doesn't seem to be true for python.

Is there any other way I can find out what attributes etc are available
to the GetFirstTet instance?

The type library is not supplied with the app. so if my basic
understanding is correct, I can't early bind.




More information about the Python-list mailing list