Executable
- class Executable(code: str, *, file_name: str = '<string>')
An
Executable
is a script that can be executed withexec()
. These allow for arbitrary execution of code when running aPythonRule
.When evaluated, a context can be provided that gets passed to the :func`globals` parameter of the
exec()
function, which can then later be used during evaluation of anEvaluatable
if modules are imported or variables are set.- Parameters:
code – The script to be evaluated.
file_name – A file name used when compiling the script, which can be helpful during error handling and bug fixing (see
compile()
).
Methods
Execute this
code
.