Skip to content Skip to sidebar Skip to footer

What The Error When I Close The Dialog

I'm just learning PyQt and I have a small application that seems to work ok unit I hit the X in the upper right corner of the dialog box to close it down. When I do that and return

Solution 1:

As the message suggests, the code includes sys.exit(app.exec_()), which will execute the GUI, and then call the exit routine. You called this from an interactive prompt, and so instead of quitting, it informed you that you tried to quit from within the thing you called. If you want to be able to call this code from an interactive prompt without the error, simply remove the exit part, change sys.exit(app.exec_()) to app.exec_().


Post a Comment for "What The Error When I Close The Dialog"