From: D-Man <ds...@ri...> - 2001-02-07 23:49:31
|
On Wed, Feb 07, 2001 at 04:03:36PM -0700, Mats Wichmann wrote: | At 02:01 PM 02/07/2001 -0500, D-Man wrote: | | Thanks. I believe it will help a bit... but I'm still in need You're welcome. | of producing a diagram and I guess the rule is that if you | REALLY understand it yourself that is not so hard. Sigh. | | >In the simplest view, Jython is just a Java library written in Java<br> | >that runs in a JVM. | | Yes, this is what my first-cut Jython picture shows... a class file | (Jython) that runs in the JVM and calls on "standard" Java classes. | What I hadn't worked out how to pictorially include was what happens | when it's run as an interpreter...or what it would look like when | Python modules are imported and called. | How do you have these Python modules? If you compiled them with jythonc --all --jar then they are java bytecodes in a jar file right next to the jython implementation's bytecodes. You would just need to include that jar in the classpath. This is good for distributing your code -- your users don't have to know anything except to have the jar in the classpath. If your Python modules are simply in *.py files, then you must include the directory they are in in the PYTHONPATH system property. I haven't dealt with this yet. If the python code is in the current directory you won't have any trouble. ex: $ jython ./myscript.py If you are embedding the interpreter in a java app, then it is up to you to find the python code (that your users have written) and feed it to the interpreter. -D |