It seems that sometimes scripts in the Analysis list in the spec file are 
interpreted as __main__ when really they are not.  I don't know if I'm 
doing something wrong or whether there is a bug.

 

I have two similar scripts that are both written in Python 3.8 on a Windows 
10 platform.  Each application has two windows that were reated using Qt 
Designer;  a main window and a QDialog window.  The Designer .ui file was 
converted to a .py file and included in the Analysis list in the spec 
file.  


After one of the frozen applications is launched and then exited, its 
QDialog window is launched and the console remains open (when console=True 
is set in the spec file).  The other frozen application exits and shuts 
down as expected.


When the .ui file ic converted to a .py file using pyuic, the following 
code is included at the bottom of the script is executed:


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_())


I commented out this section of code in the QDialog layout script and froze 
the baseline again.  This time, the main window (without anything filled 
in) launched after exiting the script.  S I commented out the same code 
from the QMainWindow layout script and now the frozen baseline exits and 
shuts down fine.


This doesn't happen with the other similar frozen baseline.


Here is the spec file I'm using:


block_cipher = None
a = Analysis(['VTMv008.py','CustomCombo.py','VTMConfig.py','VTMLayout.py'],
             pathex=['c:\\Users\\slalo\\Documents\\VTMBuild'],
             binaries=[],
             datas=[('VTMIcon.ico','.'),
                    ('VTMIconSmall.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')


Please let me know if it is something I'm doing incorrectly or whether I 
should write it up as an issue.


-- 
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/bfa38025-8eb5-4990-b527-6c8c61d16f1fo%40googlegroups.com.

Reply via email to