I saw someone on a Python post refer to it in some way, but I cannot for the life of me find it again. It was a pretty short, colloquial term, something like "gutter" or "blunk".
Is it a Python thing or do other languages call it something too?
I saw someone on a Python post refer to it in some way, but I cannot for the life of me find it again. It was a pretty short, colloquial term, something like "gutter" or "blunk".
Is it a Python thing or do other languages call it something too?
In the documentation up to Python 3.3 it's referred to as a "conditional script" stanza:
It is this environment in which the idiomatic “conditional script” stanza causes a script to run:
if __name__ == "__main__": main()
This term is gone since 3.4:
a common idiom for conditionally executing code in a module when it is run as a script or with
python -m
but not when it is imported:if __name__ == "__main__": # execute only if run as a script main()