Yes, it helps! Thank you Steve, that is a clever work around. I am happy 
with it, as I can proceed past this hiccup just fine.
Curiousity prompts me to ask: is the 'frozen' sys attribute public, e.g. 
documented in the pyinstaller documentation?
Any other goodies in there?
Arra

On Monday, September 4, 2023 at 4:04:12 AM UTC-4 Steve Barnes wrote:

> 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:* pyins...@googlegroups.com <pyins...@googlegroups.com> *On Behalf 
> Of *Arra Avakian
> *Sent:* Sunday, September 3, 2023 10:45 PM
> *To:* pyins...@googlegroups.com
> *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 pyinstaller...@googlegroups.com.
> 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 pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/b57cffde-d094-4807-a39b-caf32683dcc7n%40googlegroups.com.

Reply via email to