Embedding in JPython

Magnus Lie Hetland mlh at idi.ntnu.no
Tue Aug 1 15:21:17 EDT 2000


Steffen Ries <steffen.ries at sympatico.ca> wrote in message
news:m3d7jtjhty.fsf at gondolin.beleriand...
> Hi,
>
> just a simple question:
>
> I'm trying to embed a script into a Java application.
[...]
>
> Is there a way to call a python function directly?
>
> For now I have implemented:
>   interp.set("java_obj", javaObj);
>   interp.exec("foo(java_obj)");
> which looks rather in-elegant.

Well - this is what is done in the documentation...

But can't you wrap in a java-method foo(Object)? That way you can
at least encapsulate your in-elegance ;) And you won't have to
write the above more than once...

--

  Magnus Lie Hetland      (magnus at hetland dot org)

 "Reality is what refuses to disappear when you stop
  believing in it"                 -- Philip K. Dick






More information about the Python-list mailing list