Running Python Code
You can use Pyodide to run Python in the browser. Note that not all Python packages will run in the Pyodide runtime yet, but support for more Python functionality gets added with each new version. You can request support for packages/features here, but be sure to search for existing issues first.
To get started with Pyodide, try pasting this code in the custom code input box in the advanced area of the character editor:
Now you can use await pyodide.runPythonAsync("1+2+3")
to run code, and within our python code we can run await micropip.install("numpy")
to install stuff.
For example, here's some custom code that you can paste into your character's custom code box which will look for code blocks in their messages, and execute them:
And here's an example character with that code: