python_exec
Execute Python code with full system access for data processing, file operations, API calls, and system automation. Returns output and result, with persistent state across calls.
Instructions
Execute Python code with full system access. Returns {success, output, result, error}. Use for: data processing, file operations, API calls, system automation, any Python task. Prefer over js_exec unless JS-specific features needed. UNLOCKED: all imports (os, subprocess, requests, pathlib), file I/O, network access. Persistent state via module-level variables across calls. Limits: 30s timeout (PYTHON_EXEC_TIMEOUT env), 100k chars, 2k lines, 20k AST nodes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source code. Use print() for output. Last expression value returned in 'result'. | |
| extended_imports | No | Pre-import numpy/pandas if available. Default: false. |