This is happening because you're doing this:
thread = Thread(target = engine.start())
When you really want this:
thread = Thread(target=engine.start)
You're accidentally calling engine.start() in your main thread, so your program is getting stuck in the infinite loop that runs in that method.