run_python
Execute Python code inside an isolated sandbox and get back stdout, stderr, and exit code. Use it to run untrusted snippets or experiments without affecting the host machine.
Instructions
Run Python code inside an isolated Wasmer sandbox and get back its output.
Use it to execute code you do not want touching this machine: untrusted snippets,
experiments, quick calculations, anything with side effects you would rather contain.
code is passed to python -c, so print what you want to see. Set network=true only
when the code must reach the internet — that routes to a second sandbox with the host's
network and its own separate state. Returns exit_code, stdout, stderr, reason
and duration_ms; a non-zero exit_code is a normal result, not an error.
The sandbox is long-lived: files written and packages installed by earlier calls are
still there, and anything this code writes stays for the next one. Call
reset_sandbox when you want a clean slate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| stdin | No | ||
| network | No | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||