Python
knowledge skill
Executes a Python script in a sandboxed interpreter and returns the execution result. Produces stdout/stderr output and captured return values as a structured artifact.
Worked examples
- {"input": {"script": "print(sum(range(1, 11)))", "timeout": 5}, "output": {"stdout": "55\n", "stderr": "", "return_value": null, "exit_code": 0}}
- {"input": {"script": "import math\nmath.sqrt(-1)", "timeout": 5}, "output": {"stdout": "", "stderr": "ValueError: math domain error\n", "return_value": null, "exit_code": 1}}
Input
- script: string: valid Python code to execute
- timeout: number: max seconds to allow execution
Output
- stdout: string: standard output from execution
- stderr: string: standard error from execution
- return_value: any: result of last expression or None
- exit_code: number: process exit code
Details
- Skill type: knowledge skill
- Safety level: safe_public_research
- Version: 1.0.0