What is the point of the if __name__ == "__main__":, i.e. why use a file as both script and module?

This page summarizes the projects mentioned and recommended in the original post on /r/learnpython

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • yt-dlp-helpers

    Some helper scripts to help organize media files downloaded with yt-dlp, youtube-dl, etc.

  • Scripts are posted here. There are a handful of scripts in that repository, but videochaptermaker.py and chaptersFromYTdescription.py are the only ones relevant to this discussion.

  • hebigo

    蛇語(HEH-bee-go): An indentation-based skin for Hissp.

  • The Lissp transpiler incrementally compiles and executes each top-level form to Python. It needs to do this in case there's a macro definition that might affect the compilation of a subsequent form. If it's only executing definitions, this is harmless, but if you want to precompile the main module, it needs the guard, or the side effects will happen too.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts