> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pwno.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Python

> Run inline Python, execute scripts, and manage packages in the shared environment.

The server exposes a managed Python environment for quick analysis and scripting.

## Returned shape

All tools on this page return JSON-formatted strings.

## `execute_python_code`

Use this for one-off probes and analysis.

```json theme={null}
{"tool":"execute_python_code","arguments":{"code":"print('hello from inline python')","cwd":"/workspace","timeout":120.0}}
```

<Tip>
  Prefer this over `python -c` inside `run_command`. The subprocess backend will steer you back here if you use the wrong interface.
</Tip>

## `execute_python_script`

Use this only when a `.py` file already exists.

```json theme={null}
{"tool":"execute_python_script","arguments":{"script_path":"/workspace/solve.py","args":"--remote","cwd":"/workspace","timeout":300.0}}
```

## Package management

```json theme={null}
{"tool":"install_python_packages","arguments":{"packages":"z3-solver capstone","upgrade":false}}
{"tool":"list_python_packages","arguments":{}}
```

* `install_python_packages` installs additional packages with the shared package manager
* `list_python_packages` lists what is already present in the managed environment
* `cwd` still resolves under `/workspace`
