run_python
Execute Python code snippets in a secure sandboxed environment with configurable timeouts, memory limits, and network restrictions. Returns the output of the executed code.
Instructions
Ejecuta un fragmento de código Python y devuelve su salida.
El código corre en un subproceso separado con:
Timeout configurable (por defecto 10 segundos).
Sin acceso a red (variables de entorno anuladas).
Límite de memoria de 256 MB en Linux.
El módulo sys.exit() termina el proceso sin errores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Código Python a ejecutar. | |
| timeout | No | Tiempo máximo de ejecución en segundos (máximo 60). | |
| stdin | No | Texto a pasar como entrada estándar al programa. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |