Python & Microsoft Script Control

Alex Martelli aleaxit at yahoo.com
Fri Feb 16 15:00:25 EST 2001


"Gene C" <gchiaramonte at yahoo.com> wrote in message
news:n6aj6.848$JS2.124285 at newsread2.prod.itd.earthlink.net...
> Anyone know where I can find information on using Python with the
Microsoft
> Script Contol?

I know of no location with specific info on that, apart from Microsoft's
scripting pages (not much on the scriptcontrol itself -- it's basically a
rehash of the helpfile that comes with the scriptcontrol).  Fortunately,
there isn't much difficulty involved, as long as you have win32all
installed with your Python, or are using the ActivePython distribution.

The MS help file is VB-centered, but that goes for 99% of the docs
of all Automation object models &c -- you need to be able to read
'just enough VB to get by', it's really pretty easy.

While I haven't yet managed to 'really' make Python a part of the
applications we develop at work, the ScriptControl IS helping -- with
the rest of ActiveScripting/Automation/COM, it makes it really trivial
to let an application be scripted through any scripting language at
all -- and Python really shines when thus placed on a level playing
field with VBScript &tc.

Only itch I'm aware of, so far, is some bug which makes the
Procedures collection of the ScriptControl unusable when the
Language property is set to Python -- I'm currently working
around that with a Python-specific kludge (if operations on
the Procedures collection fail with an 'index error', Python
specific workarounds [based on Python introspection] are
used), but anyway I gave Mark Hammond a tiny program which
easily reproduces the bug, and I trust he'll fix it eventually.


Alex






More information about the Python-list mailing list