pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Martini <sandro.mart...@gmail.com>
Subject Re: FindBugs analysis before the 1.3 release
Date Fri, 31 Jul 2009 16:17:55 GMT
> What do you mean by "console"?
Jython has some very interesting features / tools, like:
a parser (as a non interactive console), but also an interactive
console where it's possible to run code inside an application, cool
not ?

Or better, is could run (embed) the Jython shell (interactive or not)
from a Java application (or Servlet if required), and then run Jython
code, or invoking java code.


Take a look:

http://wiki.python.org/jython/UserGuide#invoking-the-jython-interpreter

http://etutorials.org/Programming/Python+tutorial/Part+V+Extending+and+Embedding/Chapter+25.+Extending+and+Embedding+Jython/25.2+Embedding+Jython+in+Java/


http://onjava.com/lpt/a/1641

http://vgoenka.tripod.com/jython/jython_index.html


But attention, there are a lots of old articles, mainly referring to
the previous version 2.2.x ... now obsolete.



> The easiest way to use script in Pivot is in WTKX. You can embed your script
> code in a <wtkx:script> element. See the scripting demo for a simple
> example.
Yes, probably this is the first thing to test, but in this demo I'd
like to test also a more complex behavior, like (but i don't know if
it's possible, and how) like calling Pivot code and elements directly
from inside a Pivot Application. And this could help us to implement
other things ... like prototyping, etc.

Ah, I've just read this:
> To use JSR 223 with Jython, download the engine and add it to your classpath along with
Jython. Then use code like the above to create and use an engine. One difference between embedding
with JSR 223 and using PythonInterpreter directly is that the scripting engine manages its
own PySystemState per thread so it can always set the classloader to the thread's context
classloader. This means if you want to do anything Jython specific to PySystemState, like
adding to sys.path or setting sys.stdin and sys.stdout, you should do it after creating the
ScriptEngine.

> Note that JSR 223 currently only works with Jython 2.2.1. Support for JSR 223 should
be restored in Jython 2.5.1.



And also Scala should have something like this, or if not at the
moment, in the next release (2.8.0) yes.

What do you think ?

Bye

Mime
View raw message