PythonScript

class PythonScript(nullGlobalContext: Boolean = false) : AbstractScript, Closeable

A script engine wrapper for dynamically evaluating Python source code using the Jython engine.

Variables are bound directly to the engine without type parameter support, since Python is dynamically typed. Calls to sys.exit(), exit(), and quit() are blocked.

Parameters

nullGlobalContext

if true, sets the global scope bindings to null on initialization

See also

Constructors

Link copied to clipboard
constructor(nullGlobalContext: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun add(name: String, value: Any, vararg types: KType)

Adds a named variable to the script context.

Link copied to clipboard
open override fun close()
Link copied to clipboard
Link copied to clipboard
open fun params(name: String, types: Array<out KType>): String
Link copied to clipboard
fun resetContext(nullGlobalContext: Boolean)