From: D-Man <ds...@ri...> - 2001-02-02 15:14:39
|
On Fri, Feb 02, 2001 at 09:47:53PM +0900, syKim wrote: | | Thank you for your reply again.. You're welcome. | | I tested that two way.. | | first : same your code. | | second : I attached some code behind that like | | if __name__ == '__main__': | import pawt | pawt.test(HelloApplet(), size=(500, 120)) I'm not familiar with the "pawt" module. | | I compiled that several ways. | (just -w . or --core -d or --core -d --jar HelloApplet.jar) | | however, the applet doesn't work. | (in addition, jython should have org folder with java files --> you can know if you test with appletviewer | then, I copied the folder from jython folder to testing folder.) | | when I execute appletviewer, some error occured like that : | | java.lang.NullPointerException | | at org.python.core.PyJavaClass.lookup (PyJavaClass.java:39) | ... In PyJavaClass.java, on line 39, the Jython runtime is trying to dereference a null pointer. I don't know right now what is causing this. | | hmm.. How can I solve this problem? | | and, Is not exist another way to implement web-browser-based application with python? You could tell users to use the "Grail" browser ;-), it can execute "Python Applets". The basic problem with web-browser-based applications is your users (web browsers) must have the required interpreter/libraries available. Sun did a good job selling java, so now all browsers include a java interpreter which allows them to run java applets. Browsers aren't including a python interpreter, which makes it harder to run python code. I would expect that, since Jython is written entirely in Java, and it outputs java code that any JVM can run stuff made with jython. Now we just have to solve all the java dependencies the browsers have. I did a bit more testing: I put my html file and the class files on a web server and tried to load them. I got NoClassDefFound errors for org/python/* classes. Ok, so the jython.jar file is needed in the class path. I ran jythonc with the --jar and --all options. This put my .class files and the jython .class files nicely into a single jar file. Trying again with codebase="myapplet" in the html file (I named the jar file myapplet.jar). Now I'm getting a ClassFormatError: HelloApplet (Bad magic number) error. I think this is related to compiler/interpreter versions. I have to do some work now, but I will try again later. I'm cc'ing the list in case anyone else can shed some light on the issue. -D |