In Python, main()
is just a normal function, no different than print()
or even foo()
.
Usually, we use this code snippet:
if __name__=='__main__':
main()
So...
__name__
?__name__
is:
IF you are running it directly: '__main__'
ELSE if you imported it: Whatever name the file is. abc.py
⇒ abc
.