469,609 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Running the makepy tool automatically from a python script

Hi,
I use the makepy tool in pythonwin to generate wrappers for my
connection point (event) interfaces in a project. It works fine.
The question is; Is it possible, in a python script, to detect if
wrappers for COM (event) interfaces the script uses have been created,
and in case not somehow call the makepy tool manually before
proceeding? How should this be done?
Best regards,
Svenn-Ivar
Jul 18 '05 #1
2 3457
Svenn-Ivar Svendsen wrote:
I use the makepy tool in pythonwin to generate wrappers for my
connection point (event) interfaces in a project. It works fine.
The question is; Is it possible, in a python script, to detect if
wrappers for COM (event) interfaces the script uses have been created,
and in case not somehow call the makepy tool manually before
proceeding? How should this be done?


Run makepy.py manually with the "-i" option first, and it will
give you this sort of output:

PeterTest 1.0 type library
{7FAE1795-E030-401D-BCD9-C05CC1D318EC}, lcid=0, major=1, minor=0
# Use these commands in Python code to auto generate .py support
from win32com.client import gencache
gencache.EnsureModule('{7FAE1795-E030-401D-BCD9-C05CC1D318EC}', 0,

1, 0)

Does that help? (Basically, you need the GUID for the type library,
and the LCID and version major/minor numbers, and just pass them
to EnsureModule() as above.)

-Peter
Jul 18 '05 #2
win32com.client.gencache.EnsureDispatch('your.appl ication') will generate
the
makepy module for the interface if it doesn't already exist.
hth
Roger

"Svenn-Ivar Svendsen" <ss*******@atmel.com> wrote in message
news:67**************************@posting.google.c om...
Hi,
I use the makepy tool in pythonwin to generate wrappers for my
connection point (event) interfaces in a project. It works fine.
The question is; Is it possible, in a python script, to detect if
wrappers for COM (event) interfaces the script uses have been created,
and in case not somehow call the makepy tool manually before
proceeding? How should this be done?
Best regards,
Svenn-Ivar

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by vincent_delft | last post: by
3 posts views Thread by Behrang Dadsetan | last post: by
2 posts views Thread by nvhengr | last post: by
reply views Thread by artem.marchenko | last post: by
1 post views Thread by Steve M | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.