This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing Jython script from java and accessing resulting object

 
Kunal Sathe
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am running a jython script from my java program and I would like to access the resulting value/object. The script returns a boolean value true/false, and I want to access the value as a java.lang.Class.Boolean object. Can someone guide me in the right direction?

Thanks in advance.

Kunal

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might try:

As long as value is in the correct scope (not sure if it is).

Another thing to try would be to make the checkLastName() method return the true/false, then use interpreter.eval() to call the method and get the results. Something like this:



Note that I have no experience with Jython, but am just starting Python. So I could be way off...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic