我正在用 eclipse SWT/JFace 编写 jython 应用程序。我必须将浮点数组传递给 java 对象才能从中取回一些值。我正在使用 jarray 包。有更多的pythonic方法吗?
bounds = zeros(4, 'f')
# from java org.eclipse.swt.graphics.Path.getBounds(float[] bounds)
path.getBounds(bounds)
# from java org.eclipse.swt.graphics.Rectangle(int x, int y, int width,int height)
rect = Rectangle(int(round(bounds[0])),
int(round(bounds[1])),
int(round(bounds[2])),
int(round(bounds[3])))