Skip to content

Glossary: ML Beyond the Basics

if __name__ == "__main__":

Also written: __main__

A Python guard that runs the code under it only when the file is run directly, not when another script imports from it.

Where the book teaches it

Related terms

Module