by Sileni · 8y ago · 0 comments
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++.
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.
Interesting!
* https://assets.guitar-pro.com/1.3/images/www/guitar-pro-7/ca...
* https://www.awn.com/sites/default/files/styles/original/publ...
* 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
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??
1: https://stackoverflow.com/a/1094530/1839209
2: https://www.reddit.com/r/learnpython/comments/108zfq/tk_or_q...
3: https://www.quora.com/Should-I-use-PyQt-GTK3-or-tkinter-for-...
(If you're on Windows. On Linux, Qt could be considered native. On Mac there is PyObjC. )
> why are you using Python?
I'm not sure
> Platform-native APIs.
are a replacement for Python?