[python-win32] Tab-completion of data/properties and win32com
Jaco Schieke
win32com at ml.schieke.net
Tue Aug 3 00:37:49 CEST 2004
Mark Hammond wrote:
>>I am trying to use IPython interactively to do some win32com
>>programming
>>and want to use the completion feature. The problem is that
>>tab-completion only completes the object methods, and not the
>>associated
>>properties, for instance:
>>
>>
>
>IDLE doesn't have special knowledge of COM objects. Pythonwin does though -
>it shows the Excel properties in that example.
>
>You could try and find the place in IDLE where the list is built, and copy
>the code from pywin\scintilla\view.py - look for the comment "# The object
>may be a COM object with typelib support - lets see if we can get its
>props." Then submit a patch for IDLE, and it may well be accepted.
>
>Another cute idea would be to hack makepy to use "properties" for 2.3 and
>later - this should make them look more "real" - but IDLE may not support
>that yet (and it would be non-trivial anyway)
>
>Mark.
>
>
>
>
>
Mark,
Thanks for the advice. We misunderstood each other, but I got it
working. What I ended up doing is to patch rlcompleter.py to allow it
to get all the attributes of the COM object (as is done in pywin's
view.py). I'm currently using IPython (ipython.scipy.org) which is
using a modified rlcompleter.py due to limitations of the exising
rlcompleter.py implementation. I'll submit a patch to IPython and see
if it gets accepted there.
Would there be any point in submitting a patch against 2.3's
rlcompleter? This is a win32 specific feature, and if I understand you
correctly, it can be solved in other ways by fixing makepy.
Regards & tx for the assistance,
Jaco
More information about the Python-win32
mailing list