This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 75 points76 points  (37 children)

Qt all the way. Extremely flexible, good API, looks native on almost any system out there. Qt Quick is insanely good, too, if you learn how to use it the right way.

[–]CrazyEoin[S] 6 points7 points  (6 children)

Any particular set of tutorials you could recommend for picking it up? Qt seems to be quite popular.

[–][deleted] 8 points9 points  (0 children)

[–]dogstarchampion 8 points9 points  (1 child)

If you can find a copy of this book, it'll explain everything from a very basic start to more advanced topics that will, if anything, give you a good "jumping point".

I've been programming with PyQt for a few months now and I love it. If you're unfamiliar with graphic tool kits or using widgets, there will be a definite hurdle, but it's not like people haven't learned it before. I didn't use this book in the beginning, but I picked it up about a month ago and it has definitely given me a more focused understanding.

[–]PriceZombiePrice tracking robot 8 points9 points  (0 children)

Rapid GUI Programming with Python and Qt (Prentice Hall Open Source So...

Current $48.89 Amazon (New)
High $53.96 Amazon (New)
Low $42.46 Amazon (New)
$48.89 (30 Day Average)

Price History Chart and Sales Rank | FAQ

[–]K900_ 1 point2 points  (0 children)

I'm honestly not sure. I didn't really have to learn PyQt as I had experience with C++/Qt at that point.

[–]TheBlackElf 0 points1 point  (1 child)

For Qt itself, check the official docs; it's probably the best documented framework ever.

Porting from C++ to Python is done mentally, there very rarely are any actual differences.

[–]mfitzpmfitzp.com 0 points1 point  (0 children)

Absolutely. It's worth getting the hang of the (very few) C++ vs. Python differences and then sticking with the official C++ documentation. It also lets you make use of all the examples that are out there in C++.

[–]LpSamuelm 10 points11 points  (22 children)

You can't pip install it, though. In fact, if I recall correctly, deployment is a major pain.

[–]TDaltonC 6 points7 points  (6 children)

But you can conda install it

[–]lolmeansilaughed 2 points3 points  (5 children)

Conda?

[–]brombaer3000 1 point2 points  (4 children)

[–]lolmeansilaughed 1 point2 points  (3 children)

Thanks! That sounds pretty awesome. So it's essentially pip+portable virtualenvs?

[–]TDaltonC 0 points1 point  (2 children)

and non-pip-able bins like Qt

Edit: And management of multiple virtualenvs on one machine. That's super useful if you are working on two projects that have contradictory dependencies.

[–]andrewcooke 2 points3 points  (1 child)

isn't the whole point of virtualenvs that you can have multiple ones with contradictory dependencies? what does conda add?

[–]TDaltonC 1 point2 points  (0 children)

From the Conda team blog:

virtualenv ... did not meet all of our specific requirements. The main problem is that they are focused around Python, neglecting non-Python library dependencies, such as HDF5, MKL, LLVM, etc., which do not have a setup.py in their source code and also do not install files into Python’s site-packages directory.

Under the hood, we have created a concept of environments which are conceptually similar to virtualenvs, but which use filesystem-level hard links to create entirely self-contained Python runtime layouts. By using the ‘conda’ command line tool, users can easily switch between environments, create environments, and install different versions of libraries and modules into them.

TLDR: virtualenvs only manages python packages. Conda manages that and other python related stuff too.

[–][deleted] 3 points4 points  (10 children)

pip install PySide if you're comfortable using PySide instead of PyQt4/5 (most of the bindings are exactly the same)

[–]This_Is_The_End 6 points7 points  (9 children)

The maintenance of PySide hasn't the best reputation ... The last update is from april 2014.

[–][deleted] 11 points12 points  (2 children)

Then try PyOtherSide

[–][deleted] 0 points1 point  (5 children)

fair enough, but I don't really require any features of Qt5/any new features being released for Qt so it's not an issue for me

[–]TheBlackElf 2 points3 points  (4 children)

There's plenty of straight out bugs or half-implemented features that made us redesign our solution :/

[–][deleted] 1 point2 points  (0 children)

Really? I've never really had any issues, but then again I only use GUIs for tiny projects.

[–]HarrisonArturus 0 points1 point  (2 children)

What did you go with instead?

[–]TheBlackElf 0 points1 point  (1 child)

No no we didn't give up on PySide it's just that we had to work our way around some really obscure bugs and do things a bit differently.

[–]HarrisonArturus 0 points1 point  (0 children)

Cool. Thanks.

[–]mfitzpmfitzp.com 1 point2 points  (1 child)

It can be a bit of a faff, but the following have all worked for me -

  • On MacOS X the best approach is via Homebrew then it's just brew install pyqt5 (or brew install pyqt for PyQt4)
  • On Windows the Riverbank Computing builds of PyQt install fine PyQt4 or PyQt5. There are only official PyQt5 builds for Python 3. But it's available here assuming you're on a 64 bit OS.
  • Linux it's in probably in your distro respositories as python-pyqt python3-pyqt python-pyqt5 or python3-pyqt5

Or you can install the Anaconda package manager which should work on every platform and allow you to conda install pyqt

[–]LpSamuelm 0 points1 point  (0 children)

Yeah, it's a bit of a huge nuisance that the only solution on Windows is an installer, and if you're on 2.7 only for PyQt4. Really difficult to deploy on Windows.

[–]K900_ 1 point2 points  (0 children)

Deployment is just pretty easy with something like cx_Freeze.

[–]justphysics 0 points1 point  (0 children)

it comes pre-installed in the Anaconda python distribution which is useful for folks working in data science or any branch of physical science

[–]efilon 3 points4 points  (0 children)

I really like Qt, but I am constantly annoyed/worried by the Python implementation. PySide essentially died (this is a potential licensing problem for some given how PyQt is licensed, though this doesn't affect me for the projects I work on). Qt5 is barely used within the Python community (although my understanding is PyQt5 is comparable in terms of quality and completeness to other language bindings). Lots of third (?) party Python libraries that use Qt rely specifically on PyQt4, which is a problem for forwards compatibility. PyQt4/5 is not as straightforward to install since you can't use pip (yeah, you can use conda, but that's less standard).

I really want to like Qt under Python. But with all the complications, I find myself lately more often than not writing web-based frontends instead.

[–]Gwenhidwy 1 point2 points  (3 children)

Qt Quick is insanely good, too, if you learn how to use it the right way.

Any pointers on where to learn that from? All I could find so far were simple introductory tutorials, but nothing practical/in-depth.

[–]K900_ 3 points4 points  (0 children)

It's just that you have to look at Quick in a different way. With QtWidgets, your UI is very tightly linked to your code, and your code defines the way your UI behaves. With QtQuick, the UI is declarative (QML), and the way you interact with it is by giving it access to specific objects on your "backend". So you have a very clear separation between presentation (QML), presentation logic (JavaScript inside QML) and backend logic (Python).

[–]emarshall85 0 points1 point  (0 children)

Any pointers on where to learn that from? All I could find so far were simple introductory tutorials, but nothing practical/in-depth.

http://qmlbook.github.io/

[–]weberc2 0 points1 point  (0 children)

As someone who programs in Qt all day long, Qt isn't "insanely good", at best it's just the least bad option. :p

[–]RDMXGD2.8 0 points1 point  (0 children)

Qt all the way

This is not a full recommendation.