Dennis Chung wrote:
> Hi,
>
> I am having problems using win32com.client with the HP QTP COM
> libraries.  QTP is just another windows based application like Excel
> that exposes a COM type library for automation.
>
> In vbscript the COM library works fine as follows:
>
> Set qtp = CreateObject("QuickTest.Application")
> qtp.Launch
> MsgBox qtp.Launched  ' Prints True
>
>
> Using python:
> >>> import win32com.client
> >>> o = win32com.client.Dispatch("QuickTest.Application")
> >>> o.Launch
> <bound method CDispatch.Launch of <COMObject b'QuickTest.Application'>>
> >>> o.Launched
> False
> >>>
>
> Any idea as to why the application fails to launch when invoked with
> the python com libraries? 

Yes, because you are not invoking Launch  You are printing the address
of Launch.  VB does not require parens on a function with no
parameters.  Python does.  Use this:
    o.Launch( )

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to