[PyQt] How to detect if event loop is already running?

Panupat Chongstitwattana panupatc at gmail.com
Mon Jan 9 09:04:03 GMT 2012


Running PyQt inside Maya 2010.

If I start a UI and haven't closed it, running the script again will
completely freeze Maya and I get the message about "The event loop is
already running".

I can prevent that by manually clicking the [x] button to close the UI
before I rerun the script. But I'm wondering if there's any condition I can
check if the UI is already running? And possibly force close it?

I've checked some other emails suggesting __name__ = __main__ method, but
since my script will always be run inside Maya, the __name__ will never be
equal to __main__ I suppose.

Thanks.

Best regard,
Panupat C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120109/48acffeb/attachment.html>


More information about the PyQt mailing list