I feel like I have a good grasp of what the __name__
environment variable is in python in general. However, when I print out the __name__
variable from an __init__.py it prints out the name of the directory it's in (aka the package name). How does __name__
get defined in the init file?
Also, does each python file have its own local __name__
variable? because it's constantly changing between files... (maybe I don't understand __name__
as well as I thought I did)
EDIT: I really don't think this question is the same as the __name__
equals __main__
question. I understand what __name__
equals in most python files. I'm just still confused on what it's value is in the __init__
files.