From: ikke ekki <basmaker@ho...>  20030606 05:57:06

The problem I stated before (see below) is very crucial to our ptoject. The arrays are populated through a Java program and cannot be instantiated in the scripts. So I guess the jarray package does not help me alot. I want to be able to set the matrix to the PythonInterpreter using the set method. The scripts only asume the matrix is set by the interpreter object. So my question is: how can I set a Float[][] or float[][] into the interpreter so the matrix becomes visible for the script? And how can I get it back with the interpreter get method? Thanks for your help Problem as stated before: My problem is the following: I want to pass a multi dimensional array from my java program to the PythonInterpreter. I do this as follows: PythonInterpreter interp=new PythonInterpreter(); Float[][] inputMatrix=new Float[3][3]; interp.set("matrix",inputMatrix); This has strange behaviour in my python script if I do the following I get 30 entries for y in matrix: for z in y: print("OK") I get 30 times OK instead of 9 If I create a 2 by 2 matrix I get 10 OK So I guess I'll get for a X by X matrix (X*X+1)*X times OK Does anyone know how I can set the matrix into the interpreter and how to get it back? For getting it back I do the following: Float[][] resultMatrix = (Float[][]) interp.get("matrix",Float[][].class); This matrix is a 3 by 10 matrix, this explains the 30 OK's Can someone help me and explain what happens exactly? Where did my original 3 by 3 matrix go? Thank you very much _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail 