User Interface what the user sees when they interact with the system GUI that provides graphics and images to aid the user’s usage of the systemPython Programming

Graphical User Interface (GUI)

The Front-End, Interface

User Interface (UI) — what the user sees when they interact with the system

Graphical User Interface (GUI) — a UI that provides graphics and images to aid the user’s usage of the system

Natural User Interface (NUI) — a UI that is designed around an individuals natural movement patterns (Kinect, Leap Motion,...)

Command-driven Interface — is an interface where the user types commands and the system interprets those commands to perform tasks

Menu-driven Interface — commands are presented in some graphical way (through menu or icons). The user does not need to memorize the commands.


GUI Modules

  tkinter is Python’s standard GUI (Graphical User Interface) package.

An object-oriented layer on top of widely used graphics library Tk.

Allows you to create windows with gadgets/widgets in them.

import tkinter – OR – from tkinter import *

e  Qt (pronounced ”cute”) a cross-platform application framework and widget toolkit for creating a variety of software interfaces

run on various software and hardware platforms with little or no change in the underlying codebase (mobile as well)

Qt is currently being developed both by The Qt Company, a publicly listed company, and the Qt Project under

open-source governance.

available under both commercial licenses and open source.

The majority of tkinter is in the single module and is a part of python3 (no needing to use pip to download from

 Qt can be used in several other programming languages via

language bindings (Used in Python via PySide2)

NEED to install: pip install PySide2

The python bindings are complex and Qt is a full-blown application framework, that allows resource management/networking/graphics/user interaction/etc...

Qt modules Starting with Qt 4.0 the framework was split into individual modules.

With Qt 5.0 the architecture was modularized even further. Qt is now split into essential and add-on modules.

We will be importing specific classes and only scratching the surface of the full capability of Qt

The back-end that the bindings interact with are written in C++...which allows for more efficent code

First GUI Application

The only tkinter module needed import tkinter

# Creates a tkinter widget application app = tkinter.Tk()

print(type(app)) # <class ’tkinter.Tk’>

Qt – PySide2

# PySide2 has a lot of sub-modules, import some as we go

from PySide2 import QtWidgets

# Creates a Qt widget application app = QtWidgets.QApplication() print(type(app))

# <class ’PySide2.QtWidgets.QApplication’>

First GUI Application 2

The applications are created, ready to be deployed to memory, BUT it must be executed for it to do anything of interest. Right now it is just created and sitting dormant.


import tkinter

app = tkinter.Tk() # Creates a tkinter app app.mainloop()     # Run App

Qt – PySide2

from PySide2 import QtWidgets

app = QtWidgets.QApplication() # Creates a Qt app app.exec_() # Run App

e  For Qt, It looks like the shell/IDE froze: That’s because the application is now running...there is no user control though, can’t stop unless we force quit it (CTRL+C)



Instructions Files

Python Programming Experts

Python Programming

60 Answers

Issac Torres
Python Programming

67 Answers

View More Experts

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

270 Experts Online