I understand that if __name__ == "__main__"
is important when there are py files that your main module imports. When you deploy a much simpler .py module. where you only import pandas, sklearn etc, and none of your own helper functions, is it still a good practice to use if __name__ == "__main__"
and if so, why is that?
EDIT:
Yes, y'all are absolutely right. I meant to say this module will never be imported by other modules. Given that, should I use if __name__ == "__main__"
? and if so, why? As @MistarMiyagi pointed out, yes, if it's a good practice to use the if statement is a very open ended question. I am now asking if not using the is statement in this scenario would potentially cause any issues.