From: ikke ekki <basmaker@ho...>  20030605 13:51:59

Hi, 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 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 _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail 