[python-win32] Backing up and clearing event logs

Tim Golden mail at timgolden.me.uk
Tue Jul 24 11:06:46 CEST 2007


Mårten Hedman wrote:
> Just a comment: My current, temporary, Python environment is very basic, 
> only Python 2.5.1, pywin32 v. 210 and wmi.py v. 1.3 on a WinXP SP2 
> laptop. I have not run makepy on any type libraries. Should I do this, 
> and in that case on which library? Most of my work related python 
> programming has to do with administrating a Windows 2003 domain.

In general, the reason for running makepy is to give
win32com.client access to things like named constants
and function parameters and so on. (Means you can call
the standard Python help () on the class, too). If you
know enough about the objects you're using you don't
need to do this.

In addition, you can always call win32com.client.gencache.EnsureDispatch
on individual objects to generate their proxy modules. I initially
did this within the wmi module but then people were having problems
using it as a module within a py2exe or some other embedded system.
So I switched to using dynamic despatch and using a little function
of Thomas Heller's which pulled the constants directly from the dynamic
proxy.

In short, you probably don't need to, but it likewise probably
won't do any harm. One thing to be aware of is that, while COM
itself seems to be case-*in*sensitive, the proxy modules which
makepy generates are Python code, and so are case-sensitive. Any
existing code which used different case from the generated module
will fall over.

YM, as they say, MV
TJG


More information about the Python-win32 mailing list