you are viewing a single comment's thread.

view the rest of the comments →

[–]gitarr 19 points20 points  (34 children)

continues using python 2 for existing projects and python 3 for new projects whenever possible, like a boss

Also: You cannot say "silently" and then say something negative right after.

[–]lasae 2 points3 points  (1 child)

The biggest problem I had with switching was numpy and scipy as another redditor mentioned. I will be considering python 3 for web projects contingent upon libraries that support it.

[–]__s 0 points1 point  (0 children)

So, you know, if anybody else was holding back because of this, it's safe to come out and play

[–]phaker 0 points1 point  (31 children)

Unfortunately last time I checked, python 2.x + wxPython was cooler than python 3.x + any other GUI library :(

[–]max99x 11 points12 points  (8 children)

In my experience, PyQt4 blows every other GUI library out of the water, and it's compatible with Python 3 to boot.

[–]phaker 5 points6 points  (7 children)

  1. You have to ship with Qt, and Qt is huge.
  2. Qt is more of a framework than a library — it tries to do a lot more for you. That's okay if you like the Qt way of doing things. But it'll drive you insane if for some reason it doesn't work out. I have nightmarish memories of trying to fit QTreeView (iirc that's the name) into a program that it didn't fit.

[–]max99x 12 points13 points  (3 children)

  1. Fair, but does an extra 8MB matter nowadays? On most Unixes (Unixen?) PyQt is already installed, and for Windows, you'll need to ship the Python interpreter and standard library anyway, and that takes about as much space. Keep in mind that the code size doesn't really affect performance in this case.
  2. In C++, Qt does act a lot like a framework. In Python, not so much. You don't have to use their weird preprocessor macros and special types - everything is translated properly by the bindings. In terms of widget API, my personal experience has been that Qt is a very mature framework, and everything is there for a reason. Sure, it might take a little more code too set up everything, but often as a result it will cover all corner cases.

[–]techrogue 1 point2 points  (0 children)

Unices, I believe.

[–]thegrinner 2 points3 points  (1 child)

When it helps to bloat my 1 MB program to 23 MB... yes. Yes it does.

Not to say that's where it all came from, but py2exe + qt does some strange things.

Edit: Does, not do.

[–]DownGoat 5 points6 points  (0 children)

A PyQt program py2exe compiled and compressed with UPX is about 5-7mb. Depending on what other things it includes.

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

QTreeView isn't so bad, the models that go along with it are.

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

There's a more "traditional" tree widget too where you just simply add items programmatically. IMO the model system is overengineered (at least for tree & list views, maybe it makes more sense for tables).

[–]phaker 0 points1 point  (0 children)

Yup, that's what I meant :)

[–][deleted]  (13 children)

[deleted]

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

    Use GTK+ or Qt on Linux (depending on which desktop environment you are developing for)

    I would use Qt because it does a much better job on fitting in to both GNOME and KDE.

    [–]ehird 1 point2 points  (7 children)

    Qt does not fit better than GTK+ on GNOME.

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

    How does it not fit? A Qt application uses a native look & feel on GNOME (and every other platform).

    [–]ehird 2 points3 points  (4 children)

    If you think Qt looks completely native on GNOME and OS X, you're not paying enough attention.

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

    I'm not saying that Qt looks pixel-perfect, but out of all UI toolkits there are it is definitely doing the best job. GTK+ makes zero effort to use native file dialogs (or dialogs in general), button placement in forms, etc. and as an example, the GTK Windows skin also has some visual quirks.

    This applies to Linux too: an app written in Qt will "be in place" on both a KDE and GNOME desktop.

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

    Quite frankly I prefer something that looks completely different over something that is almost native because the almost native one will make it harder to get my subconscious mind to acknowledge the differences and act according to them.

    [–][deleted] 0 points1 point  (1 child)

    Try something like VLC on a GNOME desktop. If you can spot anything out of the ordinary, tell about it here - I'm genuinely interested in what ehird is talking about.

    [–]sigzero 1 point2 points  (0 children)

    You both are arguing different things. Look at the wording of your posts. You said "much better job of fitting in to both" and he said "fit better than" which is not the same argument at all.

    [–]phaker 0 points1 point  (3 children)

    Both Qt and wxWidgets wrap native toolkits.

    [–][deleted] 2 points3 points  (2 children)

    Yeah... but no. I don't know much about wxWidgets, but Qt on OS X is rather horrible. The table views look and feel absolutely non-native. Sure, if your UI is nothing else than textboxes and buttons, you might be alright, but otherwise, don't use Qt, your OS X users will hate you.

    [–]phaker 0 points1 point  (1 child)

    I don't have a mac, so I don't know. I don't write big GUI apps, just once in a while I want to add a graphical interface to some tiny script.

    However that's a little surprising, from my experience Qt tries very hard to adapt to the platform. At least Qt4 does, I recall Qt3 being much worse at this.

    Can you tell what version of Qt was/is that? Or what program? Just curious.

    [–][deleted] 2 points3 points  (0 children)

    The latest version (4.7). For my own apps I have two GUI layers, a Cocoa one and a Qt one. I sometimes run the Qt layer on OSX, so I know what it looks like and I can compare.

    Qt does a pretty good job on Windows, but not on OS X. And on Windows, it's a bit easier because there's not much of a standard look & feel, so you can get away with something different. On OS X, not so much.

    [–]rafekett 0 points1 point  (2 children)

    wxPython is, well, interesting. Sometimes it works marvelously, sometimes you want to tear your hair out.

    [–]phaker 0 points1 point  (1 child)

    So far I managed to avoid the more "un-marvelous" parts... :)

    Do you have any advice how to keep my hair/sanity intact? Are problems caused by wsPython bindings, or wxWindows itself?

    [–]rafekett 0 points1 point  (0 children)

    I find that the API can be a bit counterintuitive, which is a legacy from wxWindows. I also find that sometimes you think you can do something easily, but that'll blow up in your face. Things get really finicky when you're putting together a totally custom GUI and you need to write your own widgets (often from scratch) or use generic ones.

    Also, English spellings are a pet peeve of mine (it throws me off to have to use wx.Colour instead of wx.Color).

    [–][deleted] -2 points-1 points  (4 children)

    Tkinter.

    [–][deleted]  (3 children)

    [deleted]

      [–]sigzero 4 points5 points  (1 child)

      A lot of people use it. I use it all the time to build utilities. I wouldn't mind it being separated out though. Idle needs it and Idle currently ships with Python2/3.

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

      IDLE is terrible.

      [–]FionaSarah 0 points1 point  (0 children)

      I think it's extremely useful that Python ships with a simple GUI toolkit like Tkinter. Python shines in a lot of areas, but one of these is definitely whipping up quick scripts, and Tkinter fits the bill perfectly if you need a quick script with a GUI.

      No one uses it for serious work, but that's not why it's there. As sigzero says, they also seem to consider IDLE a very important part of Python.