0

I have written a program in java that controls a Finch robot, using input from a keyboard. The arrow keys control movement, awsd keys control LED colors, and jklm keys control more complicated code like a weather forecast, or a dance. Anyway, I am trying to use the CWiid python library and a raspberry pi to use a Wii remote to control the finch, instead of a keyboard. I know jython can be used to use java classes in python, but can I use it the other way around? or is there an easier way to do this?

3
  • 2
    What are python libraries? Do you mean python modules? Commented Jan 25, 2016 at 1:33
  • I guess your application is a java class, so why don't you import that into jython and feed the data from the Python package to it? Commented Jan 25, 2016 at 1:35
  • Klaus D., do you mean write a script in Jython that would use both Java and the python, acting like a bridge instead of directly importing the python into the Java program? Commented Jan 26, 2016 at 18:04

1 Answer 1

1

No, you cannot use Jython to import Python libs into Java code. If you absolutely have to run some Python from your Java program, you'll need to execute the Python interpreter as another process.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.