|
From: Kevin B. <kb...@ca...> - 2001-09-04 17:49:38
|
Ype Kingma wrote:
>
> >Hi,
> >I am using jython to test my java application. I would to know how to do the
> >following
> >
> >1.) I have a java method which returns an int array.(public int[] read())
> >How to use this method in jpython. Say I am trying to do something like this
> > int [] r = read()
> >print r
// Java
public class Arr
{
public static int[] read()
{
return new int[] { 1, 2, 3, 4 };
}
}
# Python
import Arr
l = Arr.read()
for i in l:
print i
Jython 2.1a1 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> ## working on region in file d:/TEMP/python-289_qK...
1
2
3
4
>>>
kb
|