[PyQt] Q(Core)Application.exec_() is not interruptable
İsmail Dönmez
ismail at namtrac.org
Thu May 1 21:07:23 BST 2008
Hi,
On Thu, May 1, 2008 at 10:54 PM, Ewald de Wit <erdewit at zonnet.nl> wrote:
> On Thursday 01 May 2008 14:28:31 İsmail Dönmez wrote:
> > Following code can't be interrupted with CTRL-C :
> > >>> import sys
> > >>> from PyQt4.QtCore import QCoreApplication
> > >>> QCoreApplication.exec_(sys.argv)
> >
> > Is this somehow intended and is there a way to overcome this?
>
> You can catch the signal like this:
>
> import signal
> signal.signal(signal.SIGINT, signal.SIG_DFL)
>
>
> import sys
> from PyQt4.QtCore import QCoreApplication
> app = QCoreApplication(sys.argv)
> app.exec_()
That indeed works, thanks for the tip!
--
Never learn by your mistakes, if you do you may never dare to try again.
More information about the PyQt
mailing list