How to avoid "f.close" (no parens) bug?
paul at prescod.net
Thu Feb 12 18:23:16 CET 2004
Michael Pyle wrote:
> We used this to test whether the application was running in the
> development environment or "frozen" into an executable. That knowledge
> in turn was used to decide whether to create the "Debug" menu and allow
> certain command line parameters. Very handy.
> except AttributeError:
> options.append( 'debug-on' )
A cleaner and probably more efficient way of doing this is:
if not hasattr(sys, "frozen"):
More information about the Python-list