-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (22 loc) · 670 Bytes
/
main.py
File metadata and controls
32 lines (22 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from typing import Any, Dict
import PySimpleGUI as sg
from loguru import logger
from src.gui import initialize_window
from src.handlers import handle_events
def main() -> None:
"""
Main function. Initialize the window and handle the events.
"""
window: sg.Window = initialize_window()
logger.debug("Application started.")
while True:
event: str
values: Dict[str, Any]
event, values = window.read()
if event in ["-CLOSE_BUTTON-", sg.WIN_CLOSED]:
logger.debug("Closing...")
break
handle_events(window, event, values)
window.close()
if __name__ == "__main__":
main()