I'm using Eclipse and I"m trying to create a java program that can run my python code. I'm following the guidelines on this page: http://jythonpodcast.hostjava.net/jythonbook/en/1.0/JythonAndJavaIntegration.html#using-jython-within-java-applications
But when I include these statements at the top:
package org.jython.book.util;
import org.python.core.PyObject;
import org.python.core.PyString;
import org.python.util.PythonInterpreter;
I receive a message saying "The import org.python cannot be resolved." Any suggestions on how to fix this?
Thank you so much!!
Jython does *not* support third-party Python libraries that use extensions written in C. This means that popular Python libraries like numpy, scipy and scikit-learn will not work in Jython (and, for this reason, will not work in Processing.py).
We can import any java package or class in Jython, just as we do in a Java program. The following example shows how the java. util packages are imported in Python (Jython) script to declare an object of the Date class. Save and run the above code as UtilDate.py from the command line.
The seamless interaction between Python and Java allows developers to freely mix the two languages both during development and in shipping products.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With