win32com:MakePy -- Early Binding without the size jitters?

Clark C. Evans cce at clarkevans.com
Mon Mar 26 05:04:06 EST 2001


On Sun, 11 Mar 2001, Mark Hammond wrote:
> If you are using the gencache functions to create makepy files, try 
> passing "bForDemand=1" to the functions.  This will only generate what 
> is actually used by the program, as it is used.

Mark,  

  I spent time trimming the wrapper file for MSXML,
  microsoft's XML/XSLT implementation down to the
  very few methods which I require.  I'm now creating
  DOMDocument via the following call:

      doc = msxml.DOMDocument.default_interface(
                pythoncom.CoCreateInstance( 
                    "MSXML2.DOMDocument",None, 
                     pythoncom.CLSCTX_INPROC,
                     pythoncom.IID_IDispatch))

  It seems to be working as expected, and my wrapper
  file is very very small (good deal).  So.  I'm wondering:

     Am I shooting myself in the foot?

  If not, I had another question... could something
  like the above by default be put in the wrapper file
  automagically...  I noticed that DOMDocument has a
  comment nearby saying "MSXML2.DOMDocument".

  How about making the CoClasses default to somethign
  like the above in their constructor when an argument
  (The IDispatch) is not passed. Then it would be very
  easy to use..

   import msxml3
   doc = msxml3.DOMDocument()
 

Thank you for your thoughts!

Clark






More information about the Python-list mailing list