Python: Dunder name
You may have seen if __name__ == '__main__': at the bottom of a script. Why is this there and what does it mean? First, a python file is a module. They can be combined into a directory module and this is what is being done when you see an __init__.py file in the folder. We will get there in a little while, but first we will cover a little more than just __name__. We have used dir() before, but how do you do this on the current script? To be …
