+ 1
Can somebody explain the use of __name__==__main__ in Python?
5 Réponses
+ 4
In addition to what previous fellows said, you can use __name__ attribute to run your script as a stand alone program.
if __name__ == __main__
+ 3
Jan Markus wow 👍
+ 3
By using this you can choose a part of a file (or all of the file) to be run only if that file is not imported. On the other words if it's the main file.
+ 1
Thank you all for the helpful answers..!