Widget Toolkits for Python 3 [closed]

2019-02-23 23:38发布

问题:

Because I like to future-proof my programs as much as I possibly can, I use the latest technologies under development. However, GTK (along with many other widget toolkits) does not appear to be compatible with Python 3. Are there any widget toolkits that fully support Python 3?

Thanks.

回答1:

Currently, there are two main ways of doing GTK+ programming with Python:

  • The deprecated PyGTK, which use static GTK+ bindings, and therefore tedious to maintain. It often lagged behind GTK+ state-of-the-art as a result.

  • The more modern PyGObject, which is moving towards dynamic bindings by using gobject-introspection.

Of these, only the second method works with Python 3. This work is fairly new, and you are likely going to face some bugs here and there, and perhaps changing API, not to mention not-enough documentation. If you proceed anyways, go join the mailing list and/or the IRC channel, #python @irc.gimp.net, but do start with the tutorial.