<filename>main.py
import multiprocessing
from multiprocessing import Queue
from bg import TaskHandler, create_sound_dir, init_settings
from ui import Application


def main():
    # create sounds dir if it not exists
    create_sound_dir()

    # initialize UI and BG
    tasks = Queue()
    settings = init_settings()
    handler = TaskHandler(tasks, settings)
    app = Application(tasks, settings)

    # initialize processes
    handler.start()
    app.start()

    # stop BG process when UI is closed
    handler.stop()


if __name__ == '__main__':
    multiprocessing.freeze_support()    # Allow pyinstaller use
    main()


<filename>main.py
import multiprocessing
from multiprocessing import Queue
from bg import TaskHandler, create_sound_dir, init_settings
from ui import Application


def main():
    # create sounds dir if it not exists
    create_sound_dir()

    # initialize UI and BG
    tasks = Queue()
    settings = init_settings()
    handler = TaskHandler(tasks, settings)
    app = Application(tasks, settings)

    # initialize processes
    handler.start()
    app.start()

    # stop BG process when UI is closed
    handler.stop()


if __name__ == '__main__':
    multiprocessing.freeze_support()    # Allow pyinstaller use
    main()


# create sounds dir if it not exists # initialize UI and BG # initialize processes # stop BG process when UI is closed # Allow pyinstaller use