Execute code in an event.

SEL has built-in support for running blocks of code using the following syntax:

"my_code": =Code(```python

print ("Hello, world!")


Note the following:

  • The entire code block should be placed inside triple ` marks.
  • The language of choice should follow the first ```.

While in experimental mode, rather than a return statement, Code events return values using a single print statement.

Supported languages: python, php, javascript, typescript, and ruby.

PHP code should be wrapped in <?php ?> inside the code block.

"my_php": =Code(```php


echo "Hello, world!";





If the printed object can be turned into a valid dictionary, number, list, or string, it will be. These objects may only contain literals (not executable code). If a printed object cannot be converted into a literal representation, it will simply return its string representation.


In addition to each language's standard library, the following libraries may be imported.

PythonStandard, plus requests, numpy, pillow3.12.0
JavaScript / TypeScriptStandard, plusfetch, JSONBoa, TypeScript via wsc