Hey, youtube just suggested me that, I didn't realize you were making videos. Great stuff and thanks again for the help! Indeed pyimgui is currently too close to the cpp dearimgui and would gain to be more inline with the python way. I am hoping to push it in this diretion. :)
Awesome video! I genuinely feel like this is something most programmers need to see demoed for them. It's such a vital process that I suppose most people just try to "figure out" on their own and end up making many embarrassing mistakes. Great resource video, and I'm pretty sure I will be referring people to it when they ask about the process of contributing to open-source projects :))
I wonder if perhaps this could benefit from being more explicit in the title that this is about the process of contributing to open-source projects? I clicked on this thinking that it would just be a showcase of Imgui and its features (ty for the recommendation btw)
You're a true MVP. Also, I cracked at the end with that jk. I can only imagine the pain when seeing how much of those there were. As always, great content! A couple if days ago, i sent some of my students your way, i hope they see the Light with your Teachings
The fact that I now feel really motivated to contribute to something open source is evidence of a well structured video. I also feel a sudden urge to convert my work project from a CLI to a GUI application... Not sure if that is such a necessary thing though :|
Also, is the purpose of Cython to compile C/C++ code with the syntax of Python so that people unfamiliar with such languages get an easier introduction? Or is it perhaps something more subtle?
Cython serves a dual purpose of allowing you to write Python C extensions using Pythonish syntax, as well as allowing you to easily interface with native C and C++ code. The reason for wanting to write Python C extensions is to take advantage of the fact that C compilers do optimization, whereas the Python compiler basically does not.
@@mCoding Interesting... How much usage does Cython see? I've sadly never heard about it before, so I'm presuming it's quite niche? Or maybe I have a talent for avoiding interesting things.
@@coarse_snad It finds heavy usage in tons of frameworks for the given two use cases, but is typically implemented privately with a public interface (like shown here) so you don't notice it as a regular user/non contributor.
@@coarse_snad You don't need to do manual reference counting in Cython (Py_INCREF/Py_DECREF), as compared to when writing Python C extensions. There is also less boilerplate.
Just the other day I was wondering why I still haven't seen some code-RU-vidr who was applying what they want to show to a open source project. I hope you get many internet points for this.
Wow, I hardly understand what’s going on, but it is all super interesting. I especially enjoyed the part at 6:00 of how you showed how you submitted a pull request, and how you documented your new implementation idea. This was incredible insightful and your documentation of your process and what you hope to do was fantastic. Also loved how you mentioned how you tested your code. The process of implementing your code was so through. Hope go get where you are! Thank you for this! I’ve got a lot to learn 😭😭
Great video! As mentioned by others in the comments, it's very useful to be able to follow your thought process when encountering a problem in software and how you solved it. Really enjoying and learning a ton from your amazing videos!
This is the second time I've seen great developers that I trust recommend Dear I'm Gui (first one was from The Cherno's channel!) But I have to say, I'm still not sold on Immediate GUIs. Having to do every little thing seems to go against the idea of having a library to abstract away the logic. I will nonetheless still give it a try because the end result looks very good.
I find that immediate mode GUI's are most useful when you are already doing quite a bit of things yourself or are doing something with many updates (e.g. games / rendering) so that you can integrate it closely with the actual data
As someone who mostly does web-dev that others build the interfaces for, let me just hide in the corner and reeeee-but still admire your use of pythonic ideals.
Very cool walk through of both the module and the contribution!
2 года назад
Amazing work, man. They should have made it like this from the outset, and it's great to see you helped them check that box. This video is also a great promo for Pyimgui; although I never consider making guis in Python, now you made me want to try. Keep up the great work.
Hey James!! Great video, great resource and I've finally got a little bit of understanding of what Cython is. Just letting you know that I would really appreciate a Cython overview if one day you have the time and patience. Cheers!!!
damn it's so easy to use this library. plus, contributing to open source is always great, although I feel you did a lot for one PR (but it kinda checks out i would say)
Major LOL on updating the docs later! Reminds me of my contract work at Google. My team manager wouldn't approve any code pushes until we'd verified that we'd updated the docs.
I made a PR once for a change i needed without asking. It would fail many tests and the syntax was newer JS code that they didn't support. I got it at the end and it was actually merged after 3 tries though. Don't be a knucklehead like me :D
Some of your stuff is too advanced for me, but my goodness your channel is gold This is exactly the kind of material I was looking for to become a better programmer (citizen 😉)
Great video, thanks! I've used cython to speed up the slowest part of a open source project I'm contributing to. I struggled a lot getting started and still do from time to time. I'd love to see your take on it! All the best! :)
Yes! Please do a Cython tutorial. As a longtime Python programmer, I would like to know in which use cases it might be useful to me to write my code in Cython instead.
James, can you please elaborate on what you feel is the best practice for implementing multi-threaded functionality with the imGUI event loop in Python? For example, say I have a UI for managing multiple servers and I am using the select module to check for socket read/writes. I press a button and send a command to one of the servers etc. Should the imGUI event loop be run in its own separate Thread from the socket loop? (PyQT incessantly crashed when I tried this). If so, what would the best method of 'communication' be between these two loops? IPC? Or adding commands to a queue then processing this in a third event loop separate from both imGUI and the socket loop? On that note, should any performant task be handled in the imGUI loop or will that slow down the rendering? I am assuming most people just call a function and that command gets passed to another thread where it can run asynchronously from the rendering? Thanks in advance!
Hi Drygord, great question! Typically the imgui event loop runs on the main thread, as is typical for most guis. Waiting on sockets using select (or more commonly the higher-level interface in the selectors module) should be done off the main thread. When the socket thread has some data for the main thread, set an Event and if it is set, have the main thread grab a Lock and take ownership of the data. I'm available for consulting :) mcoding.io.
This is a great video. I really appreciate it, thanks! I want to contribute to open source, but I have no idea how (or even where to start). If you can invest your time into how-to videos of contributing to open-source (the way it should be), that I believe, would be very beneficial to our community. Even if you don't have the time for other videos, thank you for this one!
Thanks, I never seen such cool C++ Ui library and what is even more cooler is that you made a video on it with python Edit: I have 140+ errors. I imported the library and everything but it says that for example it can't find imgui.io or something method
Nice, this PyImgui thing seems like a useful alternative to my beloved PySimpleGUI (which is a nice pythonic wrapper around tkinter, PyQt, WxPython or Remy).
lol at the end! i typically used tkinter for stuff like this in the past, but imgui seems way cooler, especially now that you can use it more pythonically.
I've discovered DearPyGUI recently, and have to admit, GUIs were never so easy before (with Tkinter, PyQt or else)... big thumbs up for Jonathan Hoffstadt and Preston Cothren for making imGui framework available in Python!
Why didn’t you inherit from `tuple` or a non-typing `collections.namedtuple`? That way you don’t have to manually write (part) of the tuple functionality, and miss other parts. Is that harder in Cython?
Tuple's elements are not named and i dont think i can expose them easily with names. Even if i could like namedtuple, namedtuple stores pyobject*s, not C bools so it wont be as efficient, and i dont want other tuple functionality like all the comparison operations. Theoretically it would have been fine to use tuple or namedtuple, they just didnt quite fit my needs.
Yes, the idea was that even though I don't want this object to have tuple semantics, previously it did and i don't want too break much old code, which very commonly does things like opened, selected = imgui.begin(...)
Really great video! love the idea of using the 'with' for making sure end() gets called I know it's not the point of the video, but here's a tiiiiny nitpick (I couldn't help myself I'm sorry, feel free to ignore xD) I think you got Imperative and Declarative the wrong way around at 2:50? Dear Imgui runs from start to end, "one thing after another", IE, Imperative. While the initializing everything at startup, "Declaring" the behaviour then letting it do its thing on its own, would be a declarative style.
Good question! Because Cython code must be compiled like C or C++ code, I can't just make a change in the code and re run the tests immediately. I have to recompile the library and install it again after every change (that's what pip install -e . -v does in this case). That actually involves recompiling the 11k lines of Pyimgui code as well as the even larger imgui C++ code, which is why it took so long.
I am intrigued to give this a try. It's far better than tkinter in terms of developer experience (even though it's a bit hacky). Pyqt5 still holds the first place in my opinion.
Besides the superb content you create. I watch your videos a lot, and every time I get this question popping in my head … Are you peter from spider man? But like the bad ass version of him?
images.app.goo.gl/KwnscCFE7D47zss9A Am I right or it’s just me with some 3 AM ideas?😅 I gotta say lately abstractions and inheritance concepts may have got into me and took you as a parent class which peter in spider man inherits from … but it may be just me Either way, Love your content, I learned so much from you :) Thank you!
Do the python bindings also work for imPlot or only the base imGui? I'm looking to write a simple one-window gui (no floating/docking etc) just a couple textboxes/labels, some pushbuttons... perhaps a few red/green led-like indicators. ImGui looks very clean, but does it lend itself can it do such an app?
Hey mCoding! I'd like to ask if you have any experience with kivy? And if so, how do they compare to each other. Imgui has a main drawback in my view, that it intermingles logic and presentation and I doubt that it would scale very well without any problems when creating more complex applications.
Hello! I don't have any experience with kivy. Imgui is great for rapid development, but I can see it being too simple for a large application. For medium sized it works fine though :)
Random question about PyImgui, but can a Pyimgui be compiled to an executable? Was a bit fuzzy on the line between "This is an interpreter program, using C++ extensions like Numpy" and "This is a program deeply integrated with C++, and is just a pretty transpiler for GUI writing". Assuming it was more like the Numpy scenario, but figured I'd ask because making portable little GUI applications with this sounded really neat. (Admittedly even if it didn't compile down, there is always the PyInstaller route. I'm just asking for hobbyist reasons rather than anything serious.)
Oh second note! Really appreciate this video! Really good dive into a neat topic, but also the casual-but-educational dive into contributing to open source projects never hurts. :)
Good question and thank you! Yes pyimgui is more like numpy. There is the core imgui library written in cpp, then the pyimgui module is a compiled python c extension that calls out to the imgui cpp functions at runtime. It is only portable because the pyimgui maintainer builds binary wheels of the package that include the pre-built c extension and compiled imgui library so you dont need cython or a c compiler to pip install it.
13:07 would be nice if you did videos on PEP8 and maybe just on how to document code properly, maybe you have? i should look for that, new to the channel. and love the content.
So those if's just for serializing async events in a sync flow, right? I mean, the library calls frame_commands function for every event happened in window and we just select the event with those if's?
There's no async here, it's all synchronous. The frame commands get called once per frame, not once per event. It's some kind of magic that imgui figures out what to draw from just one pass through the render commands!
Check out also my beloved PySimpleGUI. Event-based wrapper around common GUI libraries with the intention to make it far more pythonic and understandable. The spaghetti is all hidden in the library and the user-facing GUI code is also quite nice, readable, well working.
I’ve always wondered how numpy implements the @ operator for matrix multiplication. It’s not a symbol you can normally use in python. would be awesome if you used this example to dig more into python that wraps C!
I've always wanted to contribute to open source projects, but it's hard to find a project you know you can work on, you're allowed to work on, you know you can commit to the project, you know you can do things correctly, etc....