[Jython] Pass variable or class reference to PythonInterpreter?

Robert Oschler Oschler at earthlink.net
Wed Nov 6 22:36:58 EST 2002


I know I can compile a Jython class and then have it accessible as a true
Java class to other java code. But I'm wondering if I can pass a variable or
class reference to an instance of PythonInterpreter?  For example:

    private void CallInterpreter()
    {
        String theString = "Hello";

        PythonInterpreter interp = new PythonInterpreter();

        // Here I enter a loop receiving python commands and passing them to
"interp.exec()"
        // So how could I give "interp" access to "theString" so commands
passed to "exec()"
        //  can see it, print it, change it, etc?
    }

Is there a way to do this?

thx






More information about the Python-list mailing list