From: Max M. <max...@ma...> - 2001-10-19 00:57:53
|
Hi, I have actually just recently gotten into jython, very cool I must say. I am right now in the process of writing a WebObjects framework that will allow for the use of Jython WOComponents. When it is done I'll release the source and make an annoucement on this list. Anyways, right now I have written a JythonClassLoader that when given the path to a .py file it will compile the file to a .class using jythonc and then read the .class in and construct the Class object. So what I am wondering is it possible to not use jythonc to compile the .class? I have been looking through the api in the compiler package, but I haven't been able to find that magic method. What I would really like to be able to do is in my Java app read in the .py file and then using the Java api's of jython, compile the .py file into a byte array (optionally write out the .class at this point) then construct the Class object, never having to fire up a process outside the regular vm. Anyone have any ideas? Thanks in advance. Regards, Max ps - One thing that I did think of that just doesn't seem very efficient is to use the Interpreter and read in the main.py of the jythonc and try to catch the output before it goes to disk. But that sounds like it would have more overhead than just running a process outside the current process. |