Hi Arra,
Just a suggestion as a work around you could modify your "if __debug__" cases to read "if __debug__ and not getattr(sys, 'frozen', False) " this would disable the debug on your built executables for you. See https://pyinstaller.org/en/stable/runtime-information.html for more. Hope that helps, Steve Barnes From: [email protected] <[email protected]> On Behalf Of Arra Avakian Sent: Sunday, September 3, 2023 10:45 PM To: [email protected] Subject: [PyInstaller] pyinstaller is great Dear pyinstaller team, I have used pyinstaller to create executables on both Windows and MacOS. I have written a complex GUI using wxPython and pyinstaller does an amazing job! Congratulations for designing, building, and maintaining this complex tool. (I need to separately congratulate the wxPython team as well. My app uses background threading so that the GUI user can cancel any long running activity.) I am a programmer who retired after a 50+ year career that started in 1967! I first learned about programming in assembly and Fortran II on an IBM 1620. I tried using "if __debug__" in my code and found I could suppress affected code using the python option -O (optimization). I found that pyinstaller did not complain about incorrect options when I added "--python-option=-O". But it looks like the python interpreter was run without that switch. When I run my python script using the -O switch, I can see that my program is skipping over the debug dependent code. So I am guessing there might be a deeper reason that this particular python option is not supported by pyinstaller. If it becomes available in the future, I would love to hear about it! Thanks again, Arra Avakian -- 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]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/CAM_S47RFx70RrRNvNvKv47sC5zra2zeyc0nAD6-JH1Jg5F-K-Q%40mail.gmail.com<https://groups.google.com/d/msgid/pyinstaller/CAM_S47RFx70RrRNvNvKv47sC5zra2zeyc0nAD6-JH1Jg5F-K-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- 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/DU0P194MB1819B6BA530F2A4C6B7157179BE9A%40DU0P194MB1819.EURP194.PROD.OUTLOOK.COM.
