I have a code that looks like this:
app = QApplication(sys.argv) self.interface = Interface() # The figure self.fig = self.interface.fig self.ax = self.fig.add_subplot(111) self.interface.show() app.exec_() print 'this is not printed'
The problem is that after execution app.exec_()nothing happens until I close the window that pops up.
app.exec_()
How can I continue code execution?
It is intended. You will need to use signals / slots, code inside your Qt classes, or discard threads before you call app.exec ().
- Qt. "" "", " ". , - , , - , . , ( )! python.
Qt , . , , , .
, , . , Qt , , . SO.
app.exec_() , GUI, () . , ; , exec() , ( ). , exec(). .
exec()
, exec(), , QThread, ( , , "Go!", "" , ).
exec(), : - , , , , , , GUI (.. pythonw.exe python.exe), exec() , , ok, app.exec() .
pythonw.exe
python.exe
app.exec()
In addition to the previous answer, not every time all windows are closed, the GUI event loop executed app.exec_()is stopped. If you want to finish it manually, you can use it app.quit()inside any of the event handlers. It stops the GUI event loop and runs your code after app.exec_().
app.quit()
The first answer is a lot of words about nothing.
Source: https://habr.com/ru/post/1537012/More articles:Why am I getting an Apple Mach-O Linker error? - iosJava: an array of the first n integers - javaLoss of update panel trigger from data binding table in tab container - vb.netConvert char or string to bits in C ++ - c ++Programmed weight for children LinearLayout - androidHow to create a snapshot of the processor during production? - javaClient Certificate Authentication in Windows Server 2012 / IIS8 in Microsoft Azure Gets HTTP 403.16 - iismongodb orm / odm in .net? - c #F #: Downcast seq to IEnumerator - f #GlobalConfiguration - попытка доступа к полю '<> 9__CachedAnonymousMethodDelegate2' не удалось - asp.net-web-apiAll Articles