Today, most programmers are ready to break away from tradition and try to build graphical interfaces into their programs.
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
For Apple developers, we have entered the "Sw...
“ The content craftsmen lost to the content porte...
Xiaomi TV has hit a growth ceiling, and its gener...
Every time I cook at home, one second before I wa...
Introduction: Starting from the essence and findi...
An old client who I cooperated with on event mark...
Bees are an important type of pollinating insect....
In the bidding process, creative writing is essen...
The middle class’s “knowledge anxiety” has led to...
gossip “Is ‘skin hunger’ a disease that needs tre...
For a long time, iOS has been a bit inhumane, in ...
Whether it is C-end or B-end, copywriting creatio...
In the past, when people were doing brand marketi...
Preface In the Android technology circle this yea...
As games get better and better, their size also i...