Build UI in Python using the MVC pattern

Model-View-Controller

Esteban Thilliez
Tech Tavern

--

Model View Controller Pattern in Python

This story follows the User Interfaces series. You can find the other related stories here:

When it comes to building user interfaces, you have to be methodical and organized, otherwise, the code can quickly become unreadable, even messy.

I built my first UI without using any pattern, and when I wanted to scale it or modify it, it was just impossible because of the bad code. Then, I discovered the MVC pattern, and it makes things much easier.

What is the MVC Pattern

The MVC pattern is a Design Pattern (a way to structure a functionality in the code). It specifies that an application consists of 3 layers: a model, a view, and a controller linking them.

  • The model contains the pure application data, and is usually linked to a backend, or is the backend itself.
  • The view is what is shown to the user. It displays the data in a readable format and allows interactions between the user and the application in an easy and…

--

--

Esteban Thilliez
Tech Tavern

I’m Esteban, and I enjoy writing about programming, trading, productivity, knowledge management, books, etc! esteban-thilliez.com / contact@esteban-thilliez.com