Complete Tutorial on DearPyGui – GPU Accelerated Python GUI Framework

DearPyGUI is a powerful python GUI framework which is easy to use and is a wrapper for Dearlmgui.
DearpyGUI Framework

Graphical User Interface provides interaction between the user and the application. With the help of different widgets and functions, we can create a GUI of an application. Different indicators like buttons, text boxes, checkboxes can be used to build the GUI of an application.    

DearPyGUI is a powerful python GUI framework which is easy to use and is a wrapper for Dearlmgui. Dearpygui is not an ordinary python GUI framework as it does not use the native widgets but instead draws the widgets using the system’s GPU. It is an all-included GUI framework which means that it can perform and create each and every widget that is used to make GUI interfaces.

In this article, we will explore what are the different types of widgets that we can create using Dearpygui also we will see how we can leverage visualizations using Dearpygui.


Sign up for your weekly dose of what's up in emerging technology.


Like any other python library, we will install Dearpygui using pip install dearpygui.

  1. Importing Required Libraries

We will start by importing dearpygui to look at the creation of the different widgets. We will import any other library required as and when required.

from dearpygui.dearpygui import *

  1. Creating Different Widgets

As dearpygui supports a large variety of we will now explore some of the most used widgets and how we can create them. While creating an interface we need to end the python script with start_dearpygui() to launch the interface. 

  • Text Box and clickable Buttons

We can create different types of widgets using different parameters. Let us start by creating a text box and a button. We will also define and fix the Main Window Size.

set_main_window_size(400, 400)

add_text('DearPyGUI Generated This Text')

add_text('Below You Will See two buttons')

add_button("Button 1")

add_same_line(spacing=30) #Adding a space on the same line

add_button("Button 2")


Main Window
  • Radio Button and CheckBox

Next, we will see how we can create radio buttons and checkboxes. We will add all the widgets in the same window.


add_text("Below You will See a Check Box and a Radio Button")



Radio Button and Check Box
  • Menu Bar and Menu Item

Dearpygui gives us the option of creating a menu bar and menu items to it. Let us see how we can create a menu bar. We will add this menu bar to the top of the window and some items to it.

add_menu_bar("Main Menu Bar")







Menu Bar, DearPyGui

Here we have created a dropdown menu that opens up as soon as we click it. Next, we will see how we can plot visualizations on our main window using Dearpygui.

  1. Creating Visualizations

We will create a new window with a new size and visualize different plots on it.

set_main_window_size(800, 800)

add_simple_plot("Lineplot", [1, 4, 2, 8, 12], height=180)

add_simple_plot("Histogram", [1,4,2,8,12], height=180, histogram=True)


Visualization, DearPyGui

Visualizations created using Dearpygui are highly interactive and informative.

  1. Drawing/Canvas 

DearPyGui has a drawing API that is well suited for primitive drawing, custom widgets, or even dynamic drawings. Let’s see how we can use the drawing feature.

add_drawing("First_Drawing", width=300, height=300)

draw_circle("First_Drawing", [150, 150], radius=50, color=[255, 255, 255, 255], segments=0)


Drawing Canvas, DearPyGui

Other than this dearpygui also allows you to select a theme of your own choice or even create your own theme.

This is an introduction to the basic functionalities of dearpygui, it contains a lot more functions that you can explore according to your requirements.


In this article, we saw how powerful and easy to use Dearpygui is when we created a variety of widgets and visualized them in the window. We saw how we can visualize highly interactive plots in just a single line of code, we also saw the drawing capabilities of dearpygui which makes it a lot different from other general GUI frameworks. We can say that dearpygui contains a vast number of functionalities that you can use and explore according to your requirements.

More Great AIM Stories

Himanshu Sharma
An aspiring Data Scientist currently Pursuing MBA in Applied Data Science, with an Interest in the financial markets. I have experience in Data Analytics, Data Visualization, Machine Learning, Creating Dashboards and Writing articles related to Data Science.

Our Upcoming Events

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan, 2023

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

Conference, in-person (Bangalore)
MachineCon 2023
23rd Jun, 2023

Conference, in-person (Bangalore)
Cypher 2023
20-22nd Sep, 2023

3 Ways to Join our Community

Whatsapp group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our newsletter

Get the latest updates from AIM