6 ms·
I like the tutorial, but I don't know why you would use PyQt these days. Tkinter is more permissive and has wrappers like appJar which make it disgustingly easy
by Sileni 8y ago
I like the tutorial, but I don't know why you would use PyQt these days. Tkinter is more permissive and has wrappers like appJar which make it disgustingly easy to put together a quick, ugly GUI. If you're building a desktop app that needs to really look good and be fast, why are you using Python?
- HoppyHaus 8y agoI've only been a Python dev, and have ended up becoming entrenched in Tkinter. I want to be able to just use another GUI framework for when I finally switch to something else. So, I can see the use.
- deleted 8y ago[deleted]
- tudelo 8y agoWhat would you use for an app that needs to look really good and be fast?
- Longhanks 8y agoReally good? Platform-native APIs.
- deleted 8y ago[deleted]
- clear_dg 8y agoQt qualifies then, at least on Linux.
- solarkraft 8y agoQt qualifies on any platform, imo.
- clear_dg 8y agoUnless you use Qt quick which seems to be the way forward, and what many devs with html/css/js background seem to prefer. Qt widgets look close to native UIs but the feel isn't always the same, especially when you have to juggle with different platforms (all native widgets differ in subtle ways even when their function is the same).
- solarkraft 8y agoQt quick has Qt Quick Controls. Confusing naming, basically the same as Qt widgets, but built in Qt Quick (meaning they're themeable).
- cpburns2009 8y agoOn Linux, Qt and GTK are the platform native APIs.
- deleted 8y ago[deleted]
- jimnotgym 8y agoThe original post said > why are you using Python? I'm not sure > Platform-native APIs. are a replacement for Python?
- ptx 8y agoAgreed, but you can use those from Python, through pywin32 and (for a few rare things that are missing in the former) ctypes. (If you're on Windows. On Linux, Qt could be considered native. On Mac there is PyObjC. )
- toyg 8y agoPywin32 to call native apis for GUIs sounds very, very painful. I had a few run-ins with pywin32 and COM automation, I don’t think I could bear the thought of developing a full UI with that sort of hacks. At that point, might as well go C# (or IronPython, if it’s still around) and enjoy the VS goodies.
- ptx 8y agoCOM might have its issues, but I meant using the win32gui, win32api etc. modules to call the native win32 C API for UI. That's hardly a hack, and perhaps even slightly less painful than doing it from C. (I'm only using it for some fairly small things, though.)
- talltimtom 8y agoWhy not use python? It’s fast enough for most uses, and with PyQT it looks good enough on top of that it solves most cases rather fast. Sure I can make a solution that runs faster with a smaller memory footprint in Cpp, but my client doesn’t gain any value from me deciding to delay delivery to hit functional requirements they didn’t ask for and don’t need.
- radix07 8y agoI suppose if you are familiar with Tkinter and are happy with how it looks have at it! But there are a ton of things that can be leveraged from Python and Qt separately going this route. PyQt uses compiled Qt C++ code so isn't really that slow, comparable to how NumPy does it's number crunching. Even if you do find it is slow, you can always come back and branch down to the C++ level when needed, although there are ton of steps you could take to optimize in Python first. There are also all the Qt tools from UI editor and Designer to QML and way more if you really wanna go down the rabbit hole... What are you suggesting as a really good looking and fast cross platform alternative??
- mherrmann 8y agoIn my research [1] [2] [3], Tkinter was said to be better for basic applications, PyQt better for more advanced projects. 1: https://stackoverflow.com/a/1094530/1839209 https://stackoverflow.com/a/1094530/1839209 2: https://www.reddit.com/r/learnpython/comments/108zfq/tk_or_qt/ https://www.reddit.com/r/learnpython/comments/108zfq/tk_or_q... 3: https://www.quora.com/Should-I-use-PyQt-GTK3-or-tkinter-for-making-GUI-programs https://www.quora.com/Should-I-use-PyQt-GTK3-or-tkinter-for-...
- wiz21c 8y agoif you make use of editable tables, then Qt's is really powerful (the delegate thing is super cool)
- cpburns2009 8y agoI think the better appearance of Qt cross-platform is the main drawing point (at least it would be for me). If I were to make a cross-platform application, or even just a Linux one, I'd likely use Qt (with Python bindings because that's what I know). I tried using Tkinter on Linux for a simple utility, but I could not figure out the theming or find any matching themes for Ubuntu.
- captainmuon 8y ago> If you're building a desktop app that needs to really look good and be fast, why are you using Python? Why not? For an app to feel fast, you need to make it responsive and non-blocking. You can easily make apps with Python and Qt or Gtk that start instantly and never seem to hang. Discipline when it comes to not running things on the main thread, using proper async techniques etc. is more important than the number crunching ability of your programming language. And when you need raw speed, you can easily drop in some C++ code with SWIG for example. For example, I made a GUI for controlling an experimental sensor system. The GUI could look boring, but should be rock solid and always responsive, it should be easy to add new features, and it had to read data from PCIe at hundreds of MB/s or even faster. So I wrote the GUI in PyQt, the PCIe part in C++. Python allowed me to mock the hardware code out easily so I could test the GUI separately, and made it really easy to read configuration files etc. which is unneccessary painful in C++.
- gusmd 8y agoAgreed! Although I use SWIG on my job, pybind11[0] is a nice alternative that I've been looking at. [0] https://github.com/pybind/pybind11 https://github.com/pybind/pybind11
- sevensor 8y ago> more important than the number crunching ability of your programming language I work on a data visualization program written with PyQt. As an example, in a scatterplot with several hundred thousand rows, the bottleneck is not number crunching. Numpy could go up another order of magnitude. Probably two. The bottleneck is figuring out efficient ways to display all of the points, correctly, and make them pickable.
- quotemstr 8y agoThe combination of an interpreted shell with a statically-typed, AOT-compiled core is a time-tested architecture that leads to quick development times and lots of power. Python is a good choice for the former component of this mix, and if you use it, you want to be able to interact with the GUI.
- int_19h 8y agoI was recently surprised by how non-ugly a Python Tkinter app can look with some effort. Take a look at this: https://thonny.org/ https://thonny.org/
- jcelerier 8y agothat's an interesting definition of "non-ugly". I would hesitate a lot before making an app that looks like this screenshot public.
- deleted 8y ago[deleted]
- yorwba 8y agoWhat's wrong with it?
- wiz21c 8y agowell it's a bit old school but it certainly looks functional. If the program under it is good, it's a very superficial comment. If only you'd see my emacs screen, it's unbelievably ugly and somehow, I work with it every day !
- jcelerier 8y agoI was replying to a post that stated specifically that it was "non-ugly". In 2018, non-ugly means this : * https://assets.guitar-pro.com/1.3/images/www/guitar-pro-7/carousel/guitar-pro-7-sheet-music@2x.jpg https://assets.guitar-pro.com/1.3/images/www/guitar-pro-7/ca... * https://www.awn.com/sites/default/files/styles/original/public/image/featured/1025132-allegorithmic-integrates-nvidia-designworks-substance-designer.png?itok=t6GFDiwb https://www.awn.com/sites/default/files/styles/original/publ... * http://www.comptoir-hardware.com/images/stories/_software/amd-radeon-crimson-oc-ventilation.jpg http://www.comptoir-hardware.com/images/stories/_software/am... it's not what I use myself, being more of an i3/terminal guy, but it's absolutely what the clients want
- 8y ago
- liveoneggs 8y agoapparently a lot of the normal and terrible problems are worked around using this: https://build-system.fman.io/ https://build-system.fman.io/
- ajuc 8y agoFor me pyqt is just the most convenient to use. It's hard to beat on the "time to code vs quality of the result" metric.