Re: [python-win32] win32com problem with LabVIEW

2005-06-25 Thread Kuner Martin
Great, it works !!
Many thanks !!

Is that behaviour with returnvalues only valid for COM accesses, or is it 
standard python ?

Regarding the problem with the TLB-File and makepy:
Is that a makepy problem or a win32com problem ?
I´ve never entered a problem at sourceforge, so to which project belongs these 
problem ?

Martin

-Original Message-
From: Mark Hammond [mailto:[EMAIL PROTECTED] 
Sent: Saturday, 25. June 2005 4:44 AM
To: Kuner Martin; python-win32@python.org
Subject: RE: [python-win32] win32com problem with LabVIEW

> It doesn´t work with the following code:
...

> "D:\Python24\Lib\site-packages\win32com\client\makepy.py",
> line 306, in GenerateChildFromTypeLibSpec
> __import__("win32com.gen_py." + dir_name + "." + child)
> ImportError: No module named _Iapplication

That is probably a bug related to tracking down dependent typelibs.  Maybe you 
could add an entry at sourceforge?

> But now I ran into another problem.
> There is no data coming back from LabVIEW via the Call method.
> The arParVals List is unchanged after the call. Normaly the last two 
> elements should held the result of the VI call.
> In the other directon it´s working, I´m able to see the string "Hello 
> World" in LabVIEW.

Note that in Python, "out" values (including in-out) are always *returned* from 
the function.  Thus you probably want something like:

rc, newVals = oViTest.Call(arParNames,arParVals)

where 'rc' is whatever 'Call' returns - or, if 'Call' has no return value (ie a 
'void' function, or 'procedure'), simply:

newVals = oViTest.Call(arParNames,arParVals)

Mark

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] win32com problem with LabVIEW

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Kuner Martin <[EMAIL PROTECTED]> wrote:
> Is that behaviour with returnvalues only valid for COM accesses, or is it 
> standard python ?

It is standard Python, of course, like the rest of win32com interface.
Python has no "out" parameters per se, but any function can return
tuple:

>>> div_and_mod = divmod(9, 4)
>>> div_and_mod
(2, 1)

A tuple can be unpacked to separate variables:

>>> div, mod = div_and_mod
>>> div
2
>>> mod
1

But you can always combine tuple unpacking with function call:

>>> div, mod = divmod(9, 4)

HTH,
- kv
___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32