On Thu, May 28, 2020, 3:06 PM Chris Angelico
There aren't multiple entry points, though. There would be multiple blocks of code that are skipped if the module is imported, but executed if it's run as a script. Remember, Python code is NOT declarative. That 'def' statement is an actual executable bit of code.
I take back my comment. I think I may have used the multiple __main__ blocks occasionally, for reasons Chris notes. Like I want something configured BEFORE a function is defined (maybe a global that only makes sense when run as script). However, I haven't done it for a long while. I think when I was younger I didn't value encapsulation sufficiently. That said, I don't want the capability to change. There are lots of things I don't do stylistically, but I don't want striken from the language.