Python GUI – PyQt VS TKinter

11 Dec, 2020
 A GUI toolkit contains widgets that are used to create a graphical interface. Python includes a wide range of Interface implementations available, from TkInter (it comes with Python, ) to a variety of various cross-platform solutions, such as PyQt5, which is known for its more sophisticated widgets and sleek look. 
PyQt is a toolkit for graphical user interface (GUI) widgets. It is extracted from the library of Qt. PyQt is the product of the combination of the Python language and the Qt library. PyQt is coming with the Qt Builder. We will use it to get the python code from the Qt Creator. With the support of a qt designer, we can build a GUI, and then we can get python code for that GUI. PyQt supports all platforms including Windows, macOS and UNIX. PyQt can be used to create stylish GUIs, a modern and portable python framework. 
Code:
Python3
# Import sys for handle the # exit status of the application.import sys  # Importing required widgetsfrom PyQt5.QtWidgets import QApplicationfrom PyQt5.QtWidgets import QLabelfrom PyQt5.QtWidgets import QWidget  # To create an instance of QApplication# sys.argv contains the list of# command-line argumentapp = QApplication(sys.argv)  # To create an instance of application GUI# root is an instance of QWidget,# it provides all the features to# create the application's windowroot = QWidget()    # adding title to windowroot.setWindowTitle('Geeks App')   # to place txt at the coordinatesroot.move(60, 15)   # to display texttxt = QLabel('Welcome, Geeks!', parent = root) txt.move(60, 15)  # Show application's GUIroot.show()  # Run application's main loopsys.exit(app.exec_())
Output:
A simple app to display text using PyQt.
Coding versatility –GUI programming with Qt is built around the idea of signals and slots for creating contact between objects. This allows versatility in dealing with GUI incidents which results in a smoother code base.
More than a framework : Qt uses a broad variety of native platform APIs for networking, database development, and more. It provides primary access to them through a special API.
Various UI components:  Qt provides multiple widgets, such as buttons or menus, all designed with a basic interface for all compatible platforms.
Various learning resources:  As PyQt is one of the most commonly used UI systems for Python, you can conveniently access a broad variety of documentation.
Lack of Python-specific documentation for classes in PyQt5
It takes a lot of time to grasp all the specifics of PyQt, meaning it’s a pretty steep learning curve.
If the application is not open-source, you must pay for a commercial license.
Tkinter is an open-source Python Graphic User Interface (GUI) library well known for its simplicity. It comes pre-installed in Python, so you don’t even need to think about installing it. These characteristics make it a strong position for beginners and intermediates to begin with. Tkinter cannot be used for larger-scale projects.
Code:
Python3
# importing the module tkinterimport tkinter as tk  # create main window (parent window)root = tk.Tk()  # Label() it display box# where you can put any text. txt = tk.Label(root,               text="Welcome to GeekForGeeks")  # pack() It organizes the widgets# in blocks before placing in the parent widget.txt.pack()  # running the main looproot.mainloop()
Output:
A simple app to display text using tkinter.
Tkinter is easy and fast to implement as compared to any other GUI toolkit.
Tkinter is more flexible and stable.
Tkinter is included in Python, so nothing extra need to download.
Tkinter provides a simple syntax.
Tkinter is really easy to understand and master.
Tkinter provides three geometry managers: place, pack, and grid. That is much more powerful and easy to use.
Tkinter does not include advanced widgets.
It has no similar tool as Qt Designer for Tkinter.
It doesn’t have a reliable UI.
Sometime, it is hard to debug in Tkinter.
It is not purely Pythonic.
PyQt
Tkinter
Python-gui
Python-PyQt
Python-tkinter
Difference Between
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.