File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Jython/Python and the fly likes Executing Jython script from java and accessing resulting object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Executing Jython script from java and accessing resulting object" Watch "Executing Jython script from java and accessing resulting object" New topic
Author

Executing Jython script from java and accessing resulting object

Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
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

Joined: Jan 28, 2003
Posts: 3946
    
  17

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...


Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing Jython script from java and accessing resulting object
 
Similar Threads
Embedding Jython in JAVA Application
Help - How to I tell java where my jython.py script is located in the Directory
Jython?
file not found when calling execfile function
PythonInterpreter.initialize