[python-win32] *** Spam *** Re: Python-win32 Digest, Vol 33, Issue 7

Steve Holden steve at holdenweb.com
Wed Dec 7 08:55:17 CET 2005


Mark Hammond wrote:
>>>>Certainly COM would work.  In this case your VB EXE would use
> 
> CreateObject
> 
>>>>to create a Python implemented object.
> 
> 
>>As what type of Python Object?
> 
> 
>>I have the VB6 ide open, and the references Browser as well,
>>there is no generic Python object to include into a VB project.
> 
> 
>>Which means one would have to create a Python COM server
>>and Type library first, before being able to reference it
>>from the VB IDE.
> 
> 
> Actually, you don't need to create a typelib.  Just register the PythonCOM
> server, and have VB use CreateObject with the ProgID.  All vars will need to
> be declared as "object", and you wont get auto-complete type features, but
> it will work.  VB supports late-binding.
> 
> 
> 
>>Even though I have Python Programming in Win32, I'm not sure what
>>needs to be done to make a minimal Python COM server that can be
>>called from VB.
> 
> 
> Pages 221 and 222 have an example using VBA (ie, the VB embedded in MSOffice
> apps)
> 
> 
>>Also, creating a type library requires using Visual C- which isn't a
>>problem, it's the language of the IDL required to create the TLB that
>>I don't udnerstand.
> 
> 
> You should be able to avoid TLBs - certainly to get started...
> 
I'll just underline Mark's encouraging words, since you appear to be a 
little hesitant about diving in. I had to write a credit-card processor 
for a web application one of my clients wanted, and I found it was 
relatively easy to construct a Python COM server.

Although the application was in VBScript I created several test programs 
using VB, none of which had any problems manipulating the Python COM server.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/


More information about the Python-win32 mailing list