Running the makepy tool automatically from a python script

  • Thread starter Svenn-Ivar Svendsen
  • Start date
S

Svenn-Ivar Svendsen

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
 
P

Peter Hansen

Svenn-Ivar Svendsen said:
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=01, 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
 
R

Roger Upole

win32com.client.gencache.EnsureDispatch('your.application') will generate
the
makepy module for the interface if it doesn't already exist.
hth
Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top