I have 2 files. file_one.py
import file_two
print("File one __name__ is set to: {}" .format(__name__))
file_two.py
print("File two __name__ is set to: {}" .format(__name__))
when i run file_one.py
its printing:
File two __name__ is set to: file_two
File one __name__ is set to: __main__
Why is python printing the line from file_two : "File two name is set to: file_two"
I have only imported file_two, not printing anything from file_two
see example from here:
https://www.freecodecamp.org/news/if-name-main-python-example/