An open API service indexing awesome lists of open source software.

https://github.com/ziteh/python-tk-mvp

MVP pattern in Python Tkinter
https://github.com/ziteh/python-tk-mvp

gui mvp python tkinter

Last synced: about 2 months ago
JSON representation

MVP pattern in Python Tkinter

Awesome Lists containing this project

README

          

# Python Tkinter MVP

An example of MVP (Model-View-Presenter) pattern implementation with Python [Tkinter](https://docs.python.org/3/library/tkinter.html).

## Usage

```bash
python main.py
```

## UML Class Diagram

```mermaid
---
title: Tk MVP
---
classDiagram
direction TB

class PresenterInterface {
<>
on_click()
on_select(float)
}
class Presenter {
model: Model
view: ViewInterface
Presenter(Model, ViewInterface)
on_click()
on_select(float)
}

class ViewInterface {
<>
setup(PresenterInterface)
set_value(float)
get_value() float
}
class View {
root: tk.Tk
presenter: PresenterInterface
View(tk.Tk)
setup(PresenterInterface)
set_value(float)
get_value() float
}

class Model {
data: float
set_data(float)
get_data() float
}

PresenterInterface <.. View : Use
ViewInterface <|.. View : Implementation
ViewInterface <.. Presenter : Use
PresenterInterface <.. ViewInterface : Use
PresenterInterface <|.. Presenter : Implementation
Model --o Presenter : Aggregation
```