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. -- https://mail.python.org/mailman/listinfo/python-list
- Is there any advantage to using a main() in python scripts? JL
- Re: Is there any advantage to using a main() in python... Ben Finney
- Re: Is there any advantage to using a main() in py... Chris Angelico
- Re: Is there any advantage to using a main() in py... marduk
- Re: Is there any advantage to using a main() in py... Roy Smith
- Re: Is there any advantage to using a main() in py... Terry Reedy
- Re: Is there any advantage to using a main() in python... Roy Smith
- Re: Is there any advantage to using a main() in python... bob gailer
- Re: Is there any advantage to using a main() in py... Chris Angelico