#!/usr/bin/python3 class UI: def __init__(self): self.current_page = "main_menu" self.main_menu = Page() class Page: def __init__(self, elements: dict=None): if not elements is None: for name, element in elements.items(): setattr(self, name, element)