On 2007-10-25, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > The canonical case for small scripts is to have first all > functions and globals defined, then the main code protected by > a guard, ie:
There's no reason to "protect" your main code in a small script. > if __name__ == '__main__': > print SOME_CONST > if not do_something(): > try_somethin_else() That idiom is useful in modules for launching tests or examples that should not be run when the module is imported. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list