Currently the code is mostly java based, meaning the java code is returning an array and I am passing that array to another java method and it is blowing up. I might need to inject something there.


public [] getFood()
public void setFood( [] a)

in python:

b = getFood()
print b
... I get the array contents here?  so it is converted to a python array?

... Error cannot convert the type.

I guess I would need something in between getFood and setFood

On 9/16/05, Updike, Clark <> wrote:
Seems to work for me:

Jython 2.2a2 on java1.4.2_08 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import java
>>> import array
>>> sa = array.array(java.lang.String, ['hello','whirled'])
>>> java.util.Arrays.asList(sa)
[hello, whirled]

You should use array instead of jarray for 2.2.  It aligns
with cpython better (although jarray and array use the same
underlying functionality).  Eventually jarray will go away.


-----Original Message-----
From:  On Behalf Of Berlin Brown
Sent: Friday, September 16, 2005 1:26 PM
Subject: [Jython-users] Jython and jarray.array , passing args to java

Hmm, maybe I am missing something simple, but I can't
pass a jarray.array to a java method that uses arrays?
Does this functionality exist and what am I missing.
This is with the newest July2005 release of jython.