DearPyGui

2.3 · active · verified Fri Apr 17

Dear PyGui is a simple, fast, and powerful Python GUI toolkit that provides a wrapper for the Dear ImGui library. It allows for the rapid creation of highly interactive graphical user interfaces with Python, often used for tools, dashboards, and visualizations. The current version is 2.3, and it maintains an active release cadence with significant updates, including major version bumps for internal dependency upgrades and API changes.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart creates a simple DearPyGui application with a window containing text and a button. It demonstrates the basic lifecycle: context creation, viewport setup, running the main loop, and context destruction.

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='My DPG App', width=800, height=600)
dpg.setup_dearpygui()

with dpg.window(label="Example Window", width=200, height=200):
    dpg.add_text("Hello, DearPyGui!")
    dpg.add_button(label="Click Me", callback=lambda: print("Button Clicked!"))

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

view raw JSON →