After exiting a frozen application, one of the applications windows pops up 
right after the main window closes.

 

I have a frozen application with four script files created in Python 3.8 on 
a Windows 10 platform.  I created a frozen distribution folder using a spec 
file.  The main script is the first one in the Analysis list.  The other 
two script files in the Analysis list generated from using Qt Designer to 
create window layouts and then converting the .ui files to .py files.  One 
of these is the layout of a QDialog window and the other is the layout of a 
QMainWIndow layout.  At the bottom of these two window layout scripts are *if 
__name__ == “__main__”* blocks of code.   Here is the one for the QDialog 
window:

 
if __name__ == "__main__":
    import sys 
    app = QtWidgets.QApplication(sys.argv) 
    dialogConfig = QtWidgets.QDialog() 
    ui = Ui_dialogConfig() 
    ui.setupUi(dialogConfig) 
    dialogConfig.show() 
    sys.exit(app.exec_())


 

After executing and closing the frozen application, *the QDialog window 
unexpectedly launched* and the console (when I build with console=True) 
remains active.  I deleted the code block (above), refroze, executed, and 
closed.  *This time the QMainWindow unexpectedly launched* and the console, 
again, did not close.  I deleted the block of code in the QMainWindow 
layout script, refroze, executed, and closed.  This time everything 
appeared to close as expected.

 

It appears that the frozen baseline somehow thinks that the two layout 
scripts are main windows and executes them after the main application 
closes..  

 

I have a similar frozen baseline with similar script files generated y Qt 
Designer that does not exhibit this mysterious behavior.  Nor was I able to 
reproduce the issue with a minimalized script.

 

Am I doing something incorrect, or is there an issue?  Here is my spec file:

 
block_cipher = None
a = Analysis(['VTMv008.py','VTMConfig.py','VTMLayout.py'], 
             pathex=['c:\\Users\\slalo\\Documents\\VTMBuild'], 
             binaries=[], 
             datas=[('VTMIcon.ico','.'), 
                    ('VTMLicense.txt','.'), 
                    ('VTMManual.htm','.'), 
                    ('VTMManual_files','VTMManual_files')], 
             hiddenimports=[], 
             hookspath=[], 
             runtime_hooks=[], 
             excludes=[], 
             win_no_prefer_redirects=False, 
             win_private_assemblies=False, 
             cipher=block_cipher, 
             noarchive=False) 
pyz = PYZ(a.pure, a.zipped_data, 
             cipher=block_cipher) 
exe = EXE(pyz, 
          a.scripts, 
          [], 
          exclude_binaries=True, 
          name='VTMv008', 
          debug=False, 
          bootloader_ignore_signals=False, 
          strip=False, 
          upx=True, 
          console=True) 
coll = COLLECT(exe, 
               a.binaries, 
               a.zipfiles, 
               a.datas, 
               strip=False, 
               upx=True, 
               upx_exclude=[], 
               name='VTMv008')


-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/52466d13-86ea-4f8a-ae70-91bcc2b41691o%40googlegroups.com.

Reply via email to