Evaluate python statements. In interactive mode, Jep may not immediately execute the given lines of code. In that case, eval() returns false and the statement is stored and is appended to the next incoming string. If you're running an unknown number of statements, finish witheval(null)
to flush the statement buffer. Interactive mode is slower than a straight eval call since it has to compile the code strings to detect the end of the block. Non-interactive mode is faster, but code blocks must be complete. For Example:eval("if(Test):\n\tprint 'w00t'")This is a limitation on the Python interpreter and unlikely to change. Also, Python does not readly return object values from eval(). Use {@link #getValue(java.lang.String)} instead. @param str aString
value @return true if statement complete and was executed. @exception JepException if an error occurs
|
|
|
|
|
|