gsenthil25 0 Newbie Poster

Hello,

I'm trying to call a Python module in Java application using JEPP. I'm able to invoke the python modules from java Appl, but i'm not able to call the modules in python class from java appl.

Python Code

Code:

class SampleClass:
    def [b]callPythonModule[/b](self):
        print 'The Python Class module is called from Java Appl'
        return "True"

def testModule():
    print 'The Python module is called from Java Appl'

Java Code:

import jep.Jep;
    import jep.JepException;
    public class JEPPExample {
    public static void main(string args[]) {
       try {
            private Jep jep = null;
            //Calling the Python Module works fine
            String str = (String)jep.invoke("testModule");
            System.out.print("The Output of the TestModule Eexcution is " + str);
     
            /*Dont know how to call the function "callPythonModule" in the class SampleClass. like
           pobj = SampleClass() 
           pobj.callPythonModule() */

        } catch(JepException e) {
        e.printstacktrace();
       }
      }
    }

can someone please help me how to call the python class modules from Java appl using Jepp.

Thanks in Advance.

-Senthil Ganapathy