LGPL or similar GUI toolkit for Python3 and above - python

I've been using Python 3 for some months and I would like to create some GUIs. Does anyone know a good GUI Python GUI framework I could use for this?
I don't want to use TkInter because I don't think it's very good. I also don't want to use PyQt due to its licensing requirements in a commercial application.

First of all, I suggest you to stay with Python 2.x if you want to develop commercial products at this moment.
This is because it is still the most widely available version of Python.
Currently, Ubuntu ships with 2.7.2 and OS X Lion with 2.7.2, too.
Regarding PyQT, you can use Nokia's re-implementation of it, PySide. It is under LGPL, so yes, you can create commercial products. Moreover, QT also transitioned to LGPL. See QT License here.
Update: Additionally, support for Python 3.x is still under development for many GUI frameworks, PySide included.

Hummm. . . .
Hard to believe that Qt is forbidden for commercial use, as it has been created by some of the most important companies in the world . . . http://qt.nokia.com/
Go for pyQt ;)

You probably mean that PyQt can only be used for GPL projects. However, the equivalent PySide Python bindings for QT are LGPL, like QT itself, so you can use those; unfortunately, they only support Python 2.5/7 at the moment.
If you don't mind being cross-platform, you can fall back on the win32api stuff (bleh), or go the hybrid way with Jython (which supports Swing as well as any other Java-based toolkit) or IronPython (which uses .Net).

Pyside might be the best bet for you :
http://www.pyside.org/
It is basically Qt but under the LGPL license, which means you can use it in your commercial application.

Well, If you feel Qts is not suitable(thats hard to belive either) you could switch to
WxPython . It too has an good learning curve and can satisfy your commersial needs

Related

Best way to build a cross-platform and custom-skinned application with Python

Features needed:
A framework, allowing me to build tab-based application with custom design (like in Hotot twitter client), keeping the native os window frame.
Compatible with Python.
My application will be running under Win/OsX/Linux/.
No Flash/Flex/AIR.
I also would like to ask if PySide does meet my requirements and is it worse or better than wxPython and Tkinter mentioned already?
Use Tkinter. It works on every platform that Python supports, is relatively easy to program in, looks pretty good on most platforms, and has the features you want. It's also built-in for most versions of Python, so your users (in many cases) will not have to install any external dependencies.
I find that Tkinter looks best on Mac OSX and Windows, and slightly outdated on some Gnome desktops. The most important feature, however, is that the API is extremely clean and easy to use and it is very lightweight. PyQt has a similar feature set, but, in my experience, its performance is significantly degraded when compared to Tkinter.
PySide is Nokia's Qt binding for Python. I'm not aware of what the differences are between it and PyQt. Ultimately, most GUI toolkits for Python are going to be cross platform and support the functionality you need. I suggest Tkinter because I feel it is the easiest and most pleasurable way to program GUI applications in Python.
I am the author of Hotot.
according to your requirements, the key for you to choose a framework is the UI framework should be able to access webview conveniently.
Hotot has several wrappers for different platforms. On Linux, we have both Qt and GTK version, on Windows, we provide a Qt version, on Mac, we have a Cocoa version, and of course we have a Chrome version. In a word, all they can easily access webkit.
PS: XULRunner is another good choice for native appearance.
Additionally to the advices given by other people, I suggest you to use PyQt which is a Python binding to Qt framework. It's widely used, cross-platform and feature-full.
Take a look at wxPython (based on wxWidgets). If you want to make it web-based, look into using Django.
Well, you mentioned PyHotOt, and it says (on its web site) that it uses pywebkitgtk, and PyGTK. PyGTK/PyWebKitGTK exists for windows. Did you check it out? I think OS X would be the weak link on GTK, but maybe it's pretty good too.

Python - Best GUI library for the job?

I've been using WxPython and I've tried Tk, but it seems that, while both are good and I'll likely use them for other projects, neither of those appear to be capable of accomplishing the things that I want for my current project (which is fine, they're good at what they do).
Basically what I'm looking for is something that will allow me to make rich graphical GUIs. My specific goal is a window that will draw bitmap buttons, resize the parent window automatically to fit them, and possibly animate the resize with a slide effect and have the buttons fade in. Also being able to have my own window border style instead of the inbuilt one is important to me.
This particular project will be Windows only, so non-portable libraries are fine in this case, though portable ones would be great too.
If I missed how this can be done in either WxPython or Tk, I'm all ears.
PySide: http://www.pyside.org/
The PySide project provides
LGPL-licensed Python bindings for the
Qt cross-platform application and UI
framework. PySide Qt bindings allow
both free open source and proprietary
software development and ultimately
aim to support all of the platforms as
Qt itself.
The Windows version of PySide is quite new and may be considered as a beta version. PySide is API compatible with PyQt.
How about PyQt?
http://www.riverbankcomputing.co.uk/software/pyqt/intro
Just sharing my opinion: Kivy.
Innovative open-source library. Supports both 2.x and 3.x versions of Python.
Kivy - Open source Python library for rapid development of applications
that make use of innovative user interfaces, such as multi-touch apps.
Kivy is based on OpenGL ES 2 and includes native multi-touch for each platform and Android/iOS. It’s an event-driven framework based around a main loop, and is thus also suitable for game development.
Try Pyglet. Its a library for python that makes using OpenGL very easy. You can draw pretty good 2d interfaces using Quads.
I can't tell you what is best because that is subjective but I can give you another option: PyGTK
PyGTK lets you to easily create programs with a graphical user interface using the Python programming language. The underlying GTK+ library provides all kind of visual elements and utilities for it and, if needed, you can develop full featured applications for the GNOME Desktop.
PyGTK applications are truly multiplatform and they're able to run, unmodified, on Linux, Windows, MacOS X and other platforms.

Does Python have a cross-platform GUI toolkit that uses native widgets?

Python has many GUI toolkits. If I understand correctly, these toolkits typically take on the responsibility of rendering their own widgets (rather than relying on the operating system). This achieves cross-platform support at the cost of having widgets that don't necessarily look, feel and behave exactly like their native counterparts. Does Python have a GUI toolkit that is cross-platform and takes advantage of each system's native widgets?
According to GUI Programming in Python, there are at least two candidates:
Lucid
Unfortunately, this library seems to have disappeared. It's link now redirects to Icy Labs, a company that "designs and distributes components and devices for electronics and robotics development" (???).
PySWT
This is a port of the SWT library for Java (which I am already familiar with). This library doesn't feel like Python (for example, it retains the set* and get* methods that are common in Java). Therefore, I am curious to know if there is a more authoritative library that meets my needs.
Is wxWidgets an option? As far as I know, it integrates with whatever the OS has to offer - win32 on windows, gtk on Linux and, I think, Aqua on OSX.
What about Qt?
And it's attendant wrapper, PyQt?
http://en.wikipedia.org/wiki/PyQt
Qt for the most part looks native. I don't think you'll ever find a cross-platform toolkit that is uses native widgets exclusively and still be cross-platform. Those goals are to some extent mutually exclusive.
pyside LGPL bindings for qt. Note there is also PyQt which is GPL or paid for closed source use.
I found Toga recently. Think it's new, still missing a lot of native widgets but is pretty easy to pick up.

Am I supposed to use PyQT4 for programming cross-platform software in Python?

So a user suggested getting PyQT.
A quick Google gave me this: Link
Is this GUI Library for pay?
If my development environment is Ubuntu Linux, what should I download on that site. I have no idea.
Please provide links if the site I provided is not correct to what I need. Thank you.
You may want to look at PySide which is sponsored by Nokia, who own QT. It's also LGPL, which is a bit better of a license than the PyQT bindings. It's also a bit more pythonic in how it works. Unfortunately, it's new, so there isn't as much documentation. On their download page you can find information about a PPA for Ubuntu which will make it so your bindings automatically stay up to date.
If you want to run PyQT then just use APT and install python-qt3 or python-qt4.
I will answer the question you have stated in title
"Am I supposed to use PyQT4 for programming cross-platform software in Python?"
No.
You can use wxPython (http://www.wxpython.org/), it is a quite decent GUI toolkit base on wxWdigets and many commercial applications are written in wxPython e.g. www.mockupscreens.com
wxpython works on Mac/linux/Windows, has a very good support for custom widgets and provides a native looks on each platform, though you are free to design you own widgets/skins.
PyQT is comparable or may be in some cases better but costly for non GPL applications(http://qt.nokia.com/products/licensing), but wxPython is free as free beer (http://en.wikipedia.org/wiki/WxPython#License).
PyQT is released under multiple licenses: http://www.riverbankcomputing.co.uk/software/pyqt/license
You only need to pay if you don't want to release your product under the GPL.
PyQT isn't the only option for cross platform GUI in Python. There are many others too: http://wiki.python.org/moin/GuiProgramming
Near the top of the page you will find:
Source Packages
This is the latest stable version of PyQt4.
PyQt-x11-gpl-4.6.2.tar.gz Linux, UNIX source
PyQt-win-gpl-4.6.2.zip Windows source
PyQt-mac-gpl-4.6.2.tar.gz MacOS/X source
For Ubuntu, choose the first one.
You should try pyQt and wxPython both, but You will know which one better when you release your program to public.
you can install wxpython with synaptic easily.
and here is helloworld for wxpython
import wx
app = wx.App()
frame = wx.Frame(None, wx.ID_ANY, "Hello World")
frame.Show(True)
app.MainLoop()
Just my 2 cents, Sorry, If you dont like to use it.
In Ubuntu Linux, for PyQT try the package python-qt4.
An alternative is wxpython, and in Ubuntu the package is python-wxgtk2.8.
Another possibility to consider, that is considered an integral part of the Python distribution, is Tkinter, a Python interface to the Tk GUI toolkit. Tkinter is not necessarily considered as "good looking" as wxPython or PyQT, but it is definitely cross-platform, and has the blessing of being part of the Python distribution.
For cross-platform qt is the best option. GTK doesn't look well on windows, wxwidget/wxpython is ok but not so powerful and tkinter is too ugly/basic. Besides, qt4 is LGPL so you can link with it even if your application is not GPL.

What GUI toolkit looks best for a native LAF for Python in Windows and Linux?

I need to decide on a GUI/Widget toolkit to use with Python for a new project. The target platforms will be Linux with KDE and Windows XP (and probably Vista). What Python GUI toolkit looks best and consistent with the native look and feel of the run time platform?
If possible, cite strengths and weaknesses of the suggested toolkit.
Thank you,
Luis
Python binding of Wx is very strong since at least one of the core developer is a python guy itself. WxWdgets is robust, time proven stable, mature, but also bit more than just GUI. Even is a lot is left out in WxPython - because Python itself offers that already - you might find that extra convenient for your project. Wx is the fastest especially on Win, because it lets render the OS and yes WxLicense is de facto LGPL. With XRC you have also a way like Glade to click you to a UI that you can reuse by different projects and languages. What is one major reason for me to use Wx is the fast and helping mailing list, never seen a flamewar, you get even often answers from core developers there, like the notorious vadim zeitlin++. The only thing con to Wx is the API that once grew out of MS MFC and has still its darker(unelegant) corners, but with every version you have some improvements on that as well.
QT done some nice stuff, especially warping the language but under python that don't count. They invented also a lot of extra widgets. In wx you have also combined, more complex widgets like e.g. for config dialog, but that goes not that far as in QT.
And you could of course use GTK. almost no difference under linux to Wx but a bit alien and slower under win. but also free.
For KDE and Windows, Qt is the best option. Qt is fine for Gnome/Windows too, but in that case you might prefer WxWidgets.
Qt bindings for python are here.
Remember that for closed source development you need a Qt license, plus a PyQt license.
For open source it should be free, but I'm not very familiar with the PyQt licensing.
Like others said, PyQt or wxPython... The technical difference between the two is more or less imaginary - it's a question of your comfort with the toolkit that matters, really.

Categories