type

PySession

mixin PySession

Mixin for types that implement a python session.

methods

close

Close the session, and return this

define

Define a variable in local scope, and return this

eval

Evaluate the expression and return the result.

exec

Execute the given code block, and return this

init

If the session has not been initialized yet, invoke the callback with this session to allow it to do one-time setup.

kill

Kill the session - it can no longer be used again

timeout

Set the timeout for evaluating python expressions and return this

Slot Details

close

virtual This close()

Close the session, and return this

define

abstract This define(Str name, Obj? val)

Define a variable in local scope, and return this

eval

abstract Obj? eval(Str expr)

Evaluate the expression and return the result.

exec

abstract This exec(Str code)

Execute the given code block, and return this

init

abstract This init(|PySession| fn)

If the session has not been initialized yet, invoke the callback with this session to allow it to do one-time setup.

kill

virtual This kill()

Kill the session - it can no longer be used again

timeout

abstract This timeout(Duration? dur)

Set the timeout for evaluating python expressions and return this