# Examples ## IDAPython examples This collection of examples organizes all IDAPython sample code into [categories](#example-categories-overview) for easy reference. Each example demonstrates practical implementation for the IDAPython API, complementing the [reference documentation](https://python.docs.hex-rays.com/) with a real-world usage scenario. ### How to run the examples? #### Load the script via File Loader 1. Navigate to **File -> Script file...**. 2. In the new dialog, select the `.py` script you want to run and click **Open**. #### Load the script via Script command 1. Navigate to **File -> Script command...**. 2. Paste the code into _Please enter script body_ field and click **Run**. #### Load the script via output window/console 1. In the output window/IDAPython console, type the following command: `exec(open("path/to/your_script.py").read())` to execute the script. ## Example Categories: Overview
| User interface | Creating & manipulating user-interface widgets, prompting the user with forms, enriching existing widgets, or creating your own UI through Python Qt bindings. |
| Disassembly | Various ways to query, or modify the disassembly listing, alter the way analysis is performed, or be notified of changes made to the IDB. |
| Decompilation | Querying the decompiler, manipulating the decompilation trees (either at the microcode level, or the C-tree), and examples showing how to intervene in the decompilation output. |
| Debuggers | Driving debugging sessions, be notified of debugging events. |
| Working with types | These samples utilize our Type APIs, which allow you to manage the types and perform various operations on them, like creating the structures or enums and adding their members programmatically. |
| Miscellaneous | Miscellaneous examples that don't quite fall into another category, but don't really justify one of their own. |
| Level | Examples |
|---|---|
| Beginner | |
| Intermediate | |
| Advanced |
| Level | Examples |
|---|---|
| Beginner | |
| Intermediate | |
| Advanced |