Code: 1-UDG-129/15

Continuous assessment: independent work

Objective: To learn the basics of programming in Python and to create simple interactive graphical applications using the Qt 6 framework and the PySide6 library

Course syllabus:

  1. Basic concepts and introduction to Python: program and algorithm, source code, interpreter, compilation and interpretation, running Python in interactive mode and from a .py file, modules and packages.
  2. Basics of Python: numbers and strings, variables, expressions, mathematical functions, input and output, conditions, loops, lists, tuples, dictionaries, functions, classes and objects.
  3. Visual Studio Code development environment: installation of Python and Qt Python extensions, creation of a virtual environment, interpreter selection, running and debugging programs.
  4. Installation of PySide6, working with the Qt Designer tool and designing user interfaces using widgets and layouts.
  5. Connecting the user interface with Python: signals and slots, event handling and converting .ui files using the pyside6-uic tool.
  6. Drawing 2D graphics using the QPainter, QPen, QBrush, QPainterPath and QTransform classes.
  7. Basics of interactive graphics: responding to mouse events, selecting and moving objects.
  8. Creating an independent project – an interactive application for rendering a geometric construction or an interesting shape.

Downloadable files:

Literature:

SK Andrej Blaho: Programming in Python, FMFI UK, continuously updated online course
CZ Rudolf Pecinovský: Python Easily and Quickly, Grada, 2024
EN Martin Fitzpatrick: Create GUI Applications with Python & Qt6 – PySide6, 6th edition, 2025

Supplementary literature:

SK Anino Belan: Python – textbook for the seventh form of an eight-year grammar school, ŠPMNDAG Bratislava, 2013
SK Andrej Blaho: Programming in Python, UK Bratislava, 2018
CZ Rudolf Pecinovský: Starting to Program in Python, Grada, 2024, 3rd edition

Useful links for Python:

SK Introduction to Python – a concise and clear introduction to Python from the non-profit organisation Django Girls
CZ Learn Python! – Beginner’s course – a basic Python course for self-learners from the organisation PyLadies
CZ Learning to Program in Python 3 – Czech adaptation of the textbook How to Think Like a Computer Scientist
SK Programming in Python – programming course by Andrej Blaho intended for FMFI UK students
EN Official Python Tutorial – documentation and examples from the Python Software Foundation

Python:

EN Python – download – official page for downloading Python
EN Python Documentation – official language and standard library documentation

Visual Studio Code and Python:

EN Visual Studio Code – editor for writing, running and debugging programs
EN Getting Started with Python in VS Code – official introduction to programming in Python in Visual Studio Code
EN Qt Python Extension for VS Code – official extension from The Qt Company for creating and debugging PySide6 projects
EN Setting up PySide6 in Visual Studio Code – creating a virtual environment and installing PySide6

Qt and Python:

Note: PySide6 and PyQt6 provide similar interfaces to Qt 6. However, they differ in imports, some names, development tools and licensing conditions. This course uses PySide6.

EN Qt for Python – official page of the PySide6 library
EN Qt for Python – Getting Started – installation of PySide6 and creating the first application
EN Qt for Python Examples and Tutorials – official application examples
EN QPainter – official documentation of the class for drawing 2D graphics
EN Painter Example – official example of drawing using the QPainter class
EN QPainter Tutorial – Bitmap Graphics and Drawing in PySide6 – practical guide to drawing using the QPainter class
EN Graphics View Framework – working with an interactive 2D scene, graphic objects, selection, panning, zooming and rotation
EN Diagram Scene Example – demonstration of an application with custom graphic objects and connectors
EN pyside6-deploy – creating a standalone executable application

Additional links for geometric applications:

EN SymPy Geometry – calculations with points, lines, segments, circles, polygons and their intersections
EN PyVistaQt – displaying interactive 3D graphics in Qt applications
EN PyQtGraph – fast interactive graphs and scientific visualisations for PySide6 and PyQt6

Video tutorials:

EN Install and Setup PySide6 and Qt Designer – installation of PySide6 and launching the Qt Designer tool
EN Learn Python GUI Development for Desktop – comprehensive introduction to creating a simple application using PySide6 and Qt