Complete Tutorial on DearPyGui &#8211; GPU Accelerated Python GUI 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. Implementation: Like any other python library, we will install Dearpygui using pip install dearpygui. 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 * 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") start_dearpygui() 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_spacing(count=4) add_text("Below You will See a Check Box and a Radio Button") add_checkbox("Checkbox") start_dearpygui() 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") add_menu("Format") add_menu_item("form1") add_menu_item("form2") add_menu_item("form3") add_spacing(count=5) start_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. 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) start_dearpygui() Visualizations created using Dearpygui are highly interactive and informative. 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) start_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. Conclusion: 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.
DearPyGUI is a powerful python GUI framework which is easy to use and is a wrapper for Dearlmgui.
DearPyGUI a python GUI framework which is easy to use and is a wrapper for Dearlmgui. It is not a usual framework because it uses GPU.
["ai for beginners tutorial", "GUI frameworks", "PowerBI", "simple ai tutorial"]
["simple ai tutorial", "API", "GUI frameworks", "AWS", "AI", "cloud_platforms:AWS", "ai for beginners tutorial", "programming_languages:R", "RAG", "PowerBI", "Python", "programming_languages:Python", "R"]
["AI", "RAG", "AWS", "Python", "R", "API", "cloud_platforms:AWS", "programming_languages:Python", "programming_languages:R"]
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.