In article <mailman.3895.1386766655.18130.python-l...@python.org>, mar...@letterboxes.org wrote:
> I would agree with the previous post but also add that I've stopped > calling the main function "main()" and usually give it a more > descriptive name, such as "bake_cookies()" or whatever. I think that > that makes it clearer what it's doing when used as a library and the 'if > __name__ == '__main__'" already implies that it is the "main" script > function. If you're writing a library that's meant to be imported by other scripts, then that makes sense. I tend to use main() for things that are done when your script is run as a stand-alone program. That usually involves things like parsing command-line arguments, and configuring logging, neither of which you'd want to do in an importable library. -- https://mail.python.org/mailman/listinfo/python-list