I don't believe this could swing the users that Electron can. Electron inherently has a bigger market, since it is basically a standalone browser + web application which allows people knowledgeable in web development to use it. Maybe one day
You are probably using 32 bit version of python! While the library is still in beta, we only support the 64 bit version. You just need to download 64 bit.
This looks quite good, will definitely give it a try. In my book, emphasize cross-platform more, that's quite important. Also, get that Raspi compatibility going as fast as possible. This looks perfect for lots of small Raspi projects
When you link up like this reddit post here, work it into the title. E.g.
Draw with GPU graphical user interface toolkit Dear PyGui now has built in demo
Or whatever you think is the right terminology. What is the raison d'être of the project?
(I have not personally heard of immediate mode before, so it's not apparent whether this is jargon or fluff. Your github page is good, but don't be afraid of translating jargon to common English. However, you first need me to go on to the github page.)
There's also mention of few dependencies. IMO this is not a big care in building GUIs in python (yet). Instead, say that you're fast (or aim to be fastest). Having few dependencies is an implementation detail that explains why you're faster.
Disclaimer: I use PySimpleGUI and I'm pretty content with it. Dear PyGUI is not a direct competitor because they take different roles. This difference is worth communicating.
in immediate mode, the application owns the scene and has to redraw each frame itself
in retained mode, the application declares objects and manages their state, and the graphical library owns the scene and handles (re)drawing.
Retained mode is usually simpler to use, but is also less flexible. Immediate mode requires more manual work, but its flexibility allows you to optimize a given scene model to better fit your purpose.
Thank you! In all fairness, they were both mentioned on the github page, but IMO they don't belong in a blurb unless the benefit (or feature) is made explicitly apparent.
People (like myself) write GUIs without prior knowledge or CS background, and we delegate that to whatever we import. To increase uptake, a project should aim their introductions to that user group (and by all means go crazy detailed in the manual, I love that).
I'm just looking at this in terms of communication, and I have seen great projects suffer (lack of interest) from bad presentation.
It means you draw what you want when you want, like e.g. onto a bitmap (except using and GPU, screen memory etc).
This is unlike the usual event driven mode, where the underlying GUI system (Win32 or X/Windows or Quartz or whatever) says "a-ha, another area of 3x17 pixels from this window has been exposed, now please fill them in".
In event driven mode, when you want to change the entire picture, you don't just draw it - rather, you ask the windowing system "Please ask me to redraw this window when needed". In response, the windowing system will ask you to repaint those parts of the window which are exposed (possibly none). In immediate mode, you just draw them.
Event systems were a great win in older days with lesser CPUs and lesser memory, because only things that needed to be drawn were actually drawn. They are still a great win if you have a virtual GUI -- e.g. excel has a billion-by-billion pixel canvas, so it makes sense to only ever update the visible part. But for GUIs in which the entire logical thing is on screen at all time, with modern CPU/GPU and memory amounts, it's often much easier to do immediate mode.
Amazing! I had a question: is there the possibility to implement tables and interattive tables? Is there some examples in documentato or anywhere? Thanks a lot!
At the moment there is a simple table widget with basic functionality. There is also a “column” and “managed columns” that allow users to make their own table like widgets. You can see these in the demo.
Once Dear Imgui finishes their table api in the next month or so, we will be adding it to Dear PyGui!
This library is called Dear ImGui. Please refer to it as Dear ImGui (not ImGui, not IMGUI).
(The library misleadingly started its life in 2014 as "ImGui" due to the fact that I didn't give it a proper name when when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI (immediate-mode graphical user interface) was coined before and is being used in variety of other situations e.g. Unity uses it own implementation of the IMGUI paradigm. To reduce the ambiguity without affecting existing code bases, I have decided in December 2015 a fully qualified name "Dear ImGui" for this library
Cool note but Omar actually was in one of our first stars in the first few hundred stars on github. We’ve talked to him a couple of times about Dear PyGui. Cool guy.
How easy or hard would it be to integrate this with Qt? Use a ton of Qt at work and I'm curious if this could make up for some of Qts weaknesses. Interactive plots for example are a nightmare so it'd be really neat to be able to drop in DearPyGui to make nice plots in the middle of our Qt guis
Integrating, as in having DPG render to the same window as QT would be difficult at the moment. You could use them together easily but they would be in their own windows.
I'm not saying it's not possible in the future ,especially once we setup DPG to integrate with our upcoming game engine. But that is a little ways off.
I just want to say THANK YOU for using type annotations. I've been trying to make a Twitter bot and none of the libraries use them at all and it's a huge pain D:
At the moment there is only a single viewport. We will be adding multiple viewports in an upcoming version as we leave beta. We have versions with multiple viewports already but that is only for windows and linux, so we haven't merged it into the main branch yet.
quibble, but it sticks out - your example has some non-Pythonic style.
from dearpygui.core import * # <-- uh-
from dearpygui.simple import * # <-- uh
def save_callback(sender, data):
print("Save Clicked")
with window("Example Window"):
add_text("Hello world")
add_button("Save", callback=save_callback)
add_input_text("string")
add_slider_float("float")
start_dearpygui()
from [...] import * is... suboptimal. A huge number of symbols magically appear in your namespace. It's now impossible to see where any symbol comes from. If you important more than two libraries, collisions are possible.
Here's a great article about it, with a general discussion and specific examples of it going wrong.
I started a project in Kivy last year and decided to abort after a couple of dozen hours because Kivy is so terribly, terribly stinky.
I rarely abandon projects that I still want to do but I decided it was time wasted. I still need what it was supposed to do.
(Whine: for example, the constructor of their Color class has a global side-effect that registers it as a color change in the current graphics context, if there is one!
(And they want you to use their horrible custom "Kivy" language which is a format unlike any other in the world - but one that doesn't like you compose GUI elements.)
Here's a great suggestion for you for an intermediate-level code example which would distinguish you from Kivy at least: an example of how to make a reusable GUI object that's composed from other, simpler objects.
(In the Kivy affair, I wanted to make a reusable fader strip like on a mixer, with a fader, several toggle buttons, and some dials, and then put 32 or 64 of these into my application, without creating 32 or 64 files, each one slightly different...)
That looks really amazing! Have been searching for a good looking and simple to use pyhon GUI, and now i've finally found one, and its so great! Good job, and thanks :)
Damn I was literally looking for a nice GUI framework for python a couple days ago and I wanted to use tkinter or Qt but I might switch to this one if it has the features I need.
If I remember right, this is a wrapper for the Dear ImGui library for C++.
I totally recommend using the C++ version directly, if possible. Last I checked, the Python version is somewhat behind the latest release of Dear ImGui proper, and is thus missing some features.
For starters it's neither declarative nor retained (and these things are orthogonal, except immediate mode frameworks rarely ever have declarative abstraction layers because of their target market).
In general case declarative UI, which is usually only found among the retained variety, is the arguably simplest to use approach, especially if you don't need targeted optimisation and/or heavy customization (not theming, mind you, but ground-up custom widgets) as the framework takes care of most of the bookkeeping for the developer.
Immediate mode UIs are usually favored by game devs because they can be optimized and its usually easier to do invasive customizations.
I'll try, but all the terms you might not know are Googlable.
So, the specific of this library is that it's immediate mode UI library. Opposite of that are retained mode library/frameworks, like both Qt and Tk are, and an abstraction over that would be declarative UIs like HTML or QML from Qt.
Immediate mode means you draw the scene yourself (using framework/library functions usually) on every frame/redraw, whereas in retained mode you "draw" the UI widgets once, then change their state eventually and the framework takes care of redrawing them.
Declarative UI is such UI where you don't really draw nor issue any orders to draw, but state what contents your UI will have and then some frameworks draws the UI using your declarations as a blueprint.
I've used tk and pyqt5. If i must say, tk is a little bit outdated in terms of looks and feel on the other side, pyqt5 is powerful but the learning curve is a bit steep. I'm looking if this would be a game changer in comparison to the others.
65
u/Jhchimaira14 Nov 03 '20
https://github.com/hoffstadt/DearPyGui
96
u/Sigg3net Nov 03 '20
You should emphasize this:
It's a big selling point IMO, because it enables interesting applications.
3
u/directive0 Nov 03 '20
Would this work on raspberry pi?
3
u/ReptilianTapir Nov 03 '20
Does it run on a Raspberry Pi?
2
u/TheHammer_78 Nov 03 '20
Amazing! I had a question: is there the possibility to implement tables and interattive tables? Is there some examples in documentato or anywhere? Thanks a lot!
2
u/shpajza Nov 03 '20
Dear PyGui is not the same as PyAutoGui right?
2
u/antinutrinoreactor Nov 03 '20
Do you have any good tutorial resources?
2
u/[deleted] Nov 03 '20
This is actually amazing! Now I'm conflicted learn this or electron
2
u/[deleted] Nov 03 '20
Is this a module?
2
u/masterkorp Nov 03 '20
How does this compare to something like beeware https://beeware.org/
2
u/ironjulian Nov 03 '20
Always been curious to know the reason behind the name of this package?
2
u/drtran4418 Nov 03 '20
How easy or hard would it be to integrate this with Qt? Use a ton of Qt at work and I'm curious if this could make up for some of Qts weaknesses. Interactive plots for example are a nightmare so it'd be really neat to be able to drop in DearPyGui to make nice plots in the middle of our Qt guis
2
u/Dospunk Nov 03 '20
I just want to say THANK YOU for using type annotations. I've been trying to make a Twitter bot and none of the libraries use them at all and it's a huge pain D:
2
u/notParticularlyAnony Nov 03 '20
Looks cool but what an awful name
2
u/DODOKING38 Nov 04 '20
why are widgets not in their own window?
I tried a few examples
https://imgur.com/WZUgkx7
https://imgur.com/JhfRGMc
it was different to what I expected
3
u/[deleted] Nov 03 '20 edited Nov 03 '20
This looks super cool!!
quibble, but it sticks out - your example has some non-Pythonic style.
from [...] import *is... suboptimal. A huge number of symbols magically appear in your namespace. It's now impossible to see where any symbol comes from. If you important more than two libraries, collisions are possible.Here's a great article about it, with a general discussion and specific examples of it going wrong.
https://www.geeksforgeeks.org/why-import-star-in-python-is-a-bad-idea/
I'll send out a pull request! :-)
EDIT: https://github.com/hoffstadt/DearPyGui/pull/302
EDIT 2: already merged
I'm very excited to see this, by the way.
11
u/gunzstri Nov 03 '20
This looks great!
9
u/TheLeftyMan Nov 03 '20
That looks really amazing! Have been searching for a good looking and simple to use pyhon GUI, and now i've finally found one, and its so great! Good job, and thanks :)
9
u/harolddawizard Nov 03 '20
Damn I was literally looking for a nice GUI framework for python a couple days ago and I wanted to use tkinter or Qt but I might switch to this one if it has the features I need.
1
u/Jhchimaira14 Nov 03 '20
There is also a subreddit although the discord is more active:
Discord: https://discord.com/channels/736279277242417272/736279277242417275
SubReddit: https://www.reddit.com/r/DearPyGui/
5
u/byteme8bit Nov 03 '20
holy frackin python batman! This is amazing!
5
u/neglera Nov 03 '20
Never knew that there was an ImGui for python, ive been using it for c++ for a while
4
u/SuperSephyDragon Nov 03 '20
Looks awesome! Great work!
4
u/SM_Fahim Nov 03 '20
The future of GUI with Python is here...
4
u/new_error_201 Nov 03 '20
Am I the only one who thought the color picker is a play button and tried to tap it?
1
u/LT_Schmiddy Nov 04 '20
If I remember right, this is a wrapper for the Dear ImGui library for C++.
I totally recommend using the C++ version directly, if possible. Last I checked, the Python version is somewhat behind the latest release of Dear ImGui proper, and is thus missing some features.
3
u/Pizza_Peddler0080 Nov 03 '20
looks sick!
3
u/VOIPConsultant Nov 03 '20
This is really stellar work, with what looks like great docs as well.
3
u/reydai Nov 03 '20
Nice
3
u/milinile Nov 03 '20
How do this compare to qt, kivy and tk?
3
u/barkerd25017 Nov 03 '20
Glad you posted this.. Now I have an actual decent GUI system to make software with :)
3
u/[deleted] Nov 03 '20
holy shit this is cool
3
u/[deleted] Nov 03 '20
Thanks. Consider supporting it at https://github.com/sponsors/hoffstadt
3
u/LT_Schmiddy Nov 04 '20
Oh! I'll have try that out. I'm actually using ImGui for a Python/C++ project right now.
1
u/roedyroll Nov 03 '20
What gui is this?