print("Before exit()") pya.Application.instance().exit(0)