This is not a question about using if __name__ == '__main__':.  I know
what the difference is between running the script or importing it and
using the value of __name__ to determine behavior.

This is a question about the benefits of using a main() function vs not.
ie,

    if __name__ == '__main__':
        #code goes here

vs


    def main():
        #code goes here

    if __name__ == '__main__':
        main()


I personally find using main() cumbersome, but many examples I come
across use main().  Is there some fundamental benefit to using main()
that I'm missing?


-- 
David Rock
da...@graniteweb.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to