From: Dirkjan O. <di...@oc...> - 2010-04-11 19:26:07
|
I'm trying to use a Java class in a Jython script, like this: import Image Image.read('small.png') It fails, like this: Traceback (most recent call last): File "jlindet.py", line 168, in <module> main(sys.argv[1]) File "jlindet.py", line 128, in main orig = Image.read(fn) AttributeError: type object 'Image' has no attribute 'read' Could anyone tell me what I'm doing wrong? Here's my Image class: class Image { int[] size = new int[2]; ArrayList data; public Image(int[] isize) { size = isize; data = new ArrayList(size[0] * size[1]); } public static Image read(String name) throws java.io.IOException { // Snipped for brevity } } TIA, Dirkjan |