You may also wish to use something like the examples found in Jython Monthly:

http://wiki.python.org/jython/JythonMonthly/Articles/October2006/3

Best

Josh Juneau

On Feb 15, 2009 1:57pm, Jeff Emanuel <jemanuel@frii.com> wrote:
>
>
> Here's a start.
>
>
>
> class JyInline {
>
>  String code;
>
>  JyInline(String code) { this.code=code; }
>
>  Object main() {
>
>    return new PythonInterpreter().eval(this.code).__tojava__();
>
>  }
>
> }
>
>
>
> jlist9@gmail.com wrote:
>
> > The recipe here provides a way to inline Java in Jython:
>
> > http://code.activestate.com/recipes/360875/
>
> >
>
> > I wonder if there is a way to inline Jython in Java code?
>
> > That would be nice, especially if you can eval the return
>
> > value and get a Java object back
>
> >
>
> > Jack
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > ------------------------------------------------------------------------------
>
> > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>
> > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>
> > -Strategies to boost innovation and cut costs with open source participation
>
> > -Receive a $600 discount off the registration fee with the source code: SFAD
>
> > http://p.sf.net/sfu/XcvMzF8H
>
> > _______________________________________________
>
> > Jython-users mailing list
>
> > Jython-users@lists.sourceforge.net
>
> > https://lists.sourceforge.net/lists/listinfo/jython-users
>
> >
>
>
>
> ------------------------------------------------------------------------------
>
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>
> -Strategies to boost innovation and cut costs with open source participation
>
> -Receive a $600 discount off the registration fee with the source code: SFAD
>
> http://p.sf.net/sfu/XcvMzF8H
>
> _______________________________________________
>
> Jython-users mailing list
>
> Jython-users@lists.sourceforge.net
>
> https://lists.sourceforge.net/lists/listinfo/jython-users
>