1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from threading import Semaphore, Thread
guiListo = Semaphore(0)
calculoListo = Semaphore(0)

Thread(target=maneja_gui, args=[]).start()
Thread(target=maneja_calculo, args=[]).start()

def maneja_gui():
    inicializa_gui()
    guiListo.release()
    calculoListo.acquire()
    recibe_eventos()

def maneja_calculo():
    inicializa_datos()
    calculoListo.release()
    guiListo.acquire()
    procesa_calculo()