Overview of three excellent open source Python GUI frameworks

Overview of three excellent open source Python GUI frameworks

Today, most programmers are ready to break away from tradition and try to build graphical interfaces into their programs.

[[166828]]

In the Python camp, GUI programming is not particularly difficult, but it provides us with a variety of options at the beginning. As a general-purpose language, Python is naturally oriented to multiple operating systems, which undoubtedly brings obstacles to the development of graphical interfaces.

Fortunately, there are many solutions on the market that can effectively solve this problem. Windows, Mac and Linux each have a series of native UI frameworks, and many of them can even easily cross different operating systems.

But before we start designing, we need to first consider this question: Is it necessary to equip the application with a graphical user interface? If your application itself contains graphical elements and is optimized or even specifically designed for a stand-alone operating environment, then the answer is obviously yes.

But for those general-purpose programs, command line or web interface is still the best solution. The command line has more advantages in speed, remote access, reusability, script support and controllability, and the existence of libraries such as Click, Cement and Cliff also makes the command line design in the program very easy.

Similarly, we can use Django, Flask or Pyramid to easily build a web interface for the program. You can even use a library like pywebview to package the web application into a set of native-style GUI windows.

But if you still want to design a GUI, here are three excellent open source framework options.

PyQt

PyQt can implement the popular Qt library, so if you are familiar with how to use other languages ​​for Qt development, then there will be no obstacles to getting started with PyQt. It can make Python applications have a cross-platform look and feel, while inheriting the huge knowledge support and tool options brought by the Qt community.

PyQt is available under both commercial and GPL licenses (this is different from the Qt project itself). Interested friends can also click here to learn about frequently asked questions related to PyQt licensing (original English text).

Tkinter

If you want to choose a "standard" GUI toolkit for Python, the answer should be Tkinter. Tkinter is a package based on Tcl/Tk, which is a popular graphical interface and language combination that was born in the early 1990s. Tkinter's biggest advantage is that it has a wealth of resources, including text and code examples and a large user community. Through examples, we can easily get started with this graphical interface implementation solution.

Tkinter follows the Python license and is based on the BSD license of Tcl/Tk.

WxPython

WxPython brings the wxWidgets cross-platform GUI library for C++ to Python. WxPython is a more modern solution that looks more native than Tkinter, mainly because it is more platform-specific. It is easy to use and has a fast-growing developer community. However, you need to bundle wxPython with your application yourself, as it cannot be automatically installed through Python.

WxPython uses the library license of its parent project wxWindows, which is approved by OSI.

Of course, this is not your only option. If you are interested, you can click here to learn more about GUI programming in Python from the official wiki page of the Python Software Foundation.

In addition to the more traditional window design ideas, sometimes you may also want to create distinctive interface effects, especially in video games. For such needs, I recommend you try pygame and pyglet.

What are your favorite graphics frameworks? Why did you choose one? Share your experiences in the comments!

Original link: Overview of three excellent open source Python GUI frameworks

<<:  How does Shanda Games achieve automatic management of remote servers?

>>:  How to operate and maintain her community with millions of monthly active users in 8 months

Recommend

Is Apple's programming language Swift easy to learn?

For Apple developers, we have entered the "Sw...

11 economic phenomena necessary for planning and promotion

Introduction: Starting from the essence and findi...

5-step guide to Tik Tok influencer placement

An old client who I cooperated with on event mark...

Are bees also "doing early childhood education"? Scientists tell you

Bees are an important type of pollinating insect....

What are the creative writing techniques for Baidu bidding accounts?

In the bidding process, creative writing is essen...

How do knowledge payment platforms increase user growth? 5 routines!

The middle class’s “knowledge anxiety” has led to...

iOS 14 exposure: Apple is expected to allow users to change the default browser

For a long time, iOS has been a bit inhumane, in ...

How should we write copy when facing “cold” B-end products?

Whether it is C-end or B-end, copywriting creatio...

20 suggestions for private domain traffic operations!

In the past, when people were doing brand marketi...

A fast integration framework: MVP+Dagger+mainstream framework, it is enough

Preface In the Android technology circle this yea...

The game is so small that it is less than 1KB

As games get better and better, their size also i...