jython: user-defined modules

G

Gregor Stich

Dear all,

I hope my question is here in the right place...
What I want to achieve is a communication between Java and Python. We
have a pretty strong framework of existing python scripts and modules.
Now I want to use jython in order to faciliate the communication
between another Java framework.

But I`m currently stuck with jython: Trying to import the user-defined
python modules, these cannot be found. I read a lot about the jython
registry and I setup a $HOME/.jython file where I created a
python.path=... resource, however, when I start the jython command
line and type
print python.path
then this property is not found. Passing it with the -D option does
not work as well, or maybe I`m too confused to make it work anyway?

Any help would be great!
Best regards
Greg
 
D

Diez B. Roggisch

Gregor said:
Dear all,

I hope my question is here in the right place...
What I want to achieve is a communication between Java and Python. We
have a pretty strong framework of existing python scripts and modules.
Now I want to use jython in order to faciliate the communication
between another Java framework.

But I`m currently stuck with jython: Trying to import the user-defined
python modules, these cannot be found. I read a lot about the jython
registry and I setup a $HOME/.jython file where I created a
python.path=... resource, however, when I start the jython command
line and type
print python.path
then this property is not found. Passing it with the -D option does
not work as well, or maybe I`m too confused to make it work anyway?

First of all, you should subscribe to the jython mailing list.

Second, you access the python.path inside jython via

import sys
print sys.path

HTH,

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top