Using the method wait() rather than connect() on an event will cause your script to wait until the event has occurred.
Stay tuned!