# Dear PyGui — GPU-Accelerated Python GUI Framework > Build fast, interactive desktop applications and data tools in Python using an immediate-mode GPU-rendered graphical interface with zero external dependencies. ## Install Save as a script file and run: # Dear PyGui — GPU-Accelerated Python GUI Framework ## Quick Use ```bash pip install dearpygui python -c " import dearpygui.dearpygui as dpg dpg.create_context() dpg.create_viewport(title='Demo', width=600, height=400) with dpg.window(label='Hello'): dpg.add_text('Hello, Dear PyGui!') dpg.add_button(label='Click Me') dpg.setup_dearpygui() dpg.show_viewport() dpg.start_dearpygui() dpg.destroy_context() " ``` ## Introduction Dear PyGui is a Python GUI framework built on top of Dear ImGui that provides GPU-accelerated rendering for desktop applications. It targets developers who need fast, interactive interfaces for data visualization, tooling, and scientific applications without the complexity of traditional retained-mode GUI frameworks. ## What Dear PyGui Does - Renders UI elements using the GPU via DirectX/Metal/OpenGL for smooth performance even with complex layouts - Provides 70+ widgets including plots, tables, node editors, color pickers, and file dialogs - Updates at frame rate rather than event-driven, making it ideal for real-time data dashboards - Ships as a single pip-installable package with no system-level dependencies - Runs on Windows, macOS, and Linux from the same Python code ## Architecture Overview Dear PyGui wraps the C++ Dear ImGui library through a custom CPython extension. Each frame, the immediate-mode render loop processes widget state and draws to a GPU-backed framebuffer. This architecture avoids the overhead of a widget tree and event dispatch system, resulting in minimal latency between data changes and screen updates. The Python API abstracts the frame loop behind a context manager pattern. ## Self-Hosting & Configuration - Install with `pip install dearpygui` — prebuilt wheels available for Windows, macOS, and Linux - Create a context with `dpg.create_context()` and a viewport with `dpg.create_viewport()` - Organize UI into windows, groups, and tabs using Python context managers - Configure themes, fonts, and styles globally or per-widget using the theming API - Enable DPI scaling and high-resolution rendering via viewport configuration flags ## Key Features - Built-in plotting engine with line, scatter, bar, heatmap, and candlestick chart types - Node editor widget for building visual graph-based interfaces - Callback system for responding to clicks, value changes, drag-and-drop, and keyboard input - Runtime theme and style editing with a built-in style editor debug tool - Supports textures, drawing canvases, and custom rendering for advanced visualizations ## Comparison with Similar Tools - **Tkinter** — Python standard library GUI; Dear PyGui offers GPU rendering and richer widget set - **PyQt/PySide** — Full-featured retained-mode frameworks with steeper learning curves and licensing considerations - **Dear ImGui (C++)** — The underlying C++ library; Dear PyGui provides a Pythonic API layer on top - **Streamlit** — Web-based data apps; Dear PyGui is a native desktop framework with lower latency - **Gradio** — ML demo builder for the browser; Dear PyGui targets desktop applications requiring real-time rendering ## FAQ **Q: Is Dear PyGui suitable for production applications?** A: Yes. It is used in production for data dashboards, scientific tools, and game development utilities where GPU-accelerated rendering matters. **Q: Can I embed matplotlib or other plotting libraries?** A: Dear PyGui has its own plotting engine. For matplotlib integration you would render to a texture, but the built-in plots cover most use cases. **Q: Does it support multithreading?** A: The render loop runs on the main thread. You can use Python threading for background data processing and update widget values from callbacks. **Q: What Python versions are supported?** A: Dear PyGui supports Python 3.8 and above on all major operating systems. ## Sources - https://github.com/hoffstadt/DearPyGui - https://dearpygui.readthedocs.io/ --- Source: https://tokrepo.com/en/workflows/asset-ebc6dce7 Author: Script Depot