From: Antonio R. <An...@ho...> - 2001-09-12 12:56:52
|
Hi all, I'm not sure if its called byte-compiling in jython, but is there a way to turn all of the standard library that ships with Jython into .class files, stick them into a jar and set the PythonInterpreter instances to load them from there as opposed to from the Lib directory? On a related note, what is the equivalent of PythonInterpreter.execfile() when one wnats to exec a .class file instead of the .py file? To clarify, right now, what I generally do to use jython objects in my java programs is 1) subclass a java classs (so I can call methods from java), 2) instantiate an interpreter in java and call interpreter.execfile ( PySubclass.py ), 3) create the PyObject of the subclass and coerce it into the right type of java object through the __tojava__ method. Then I happily use the object as a full on java object. While this is very very very cool (one of the coolest things I've ever seen in java-- kudos to all of you), I'm wondering whether there might be a more efficient way to do this, and I find that not having to reparse/recompile the .py file every time is probably a good place to start. I looked at some of the code that jythonc generates, but I am at a loss as to how to get java objects out of all of those static inner class methods. Thanks for the help, Antonio |