+ 1
if __name__ == "__main__":
hey there! i found this on most of codes on net. i do not know what does it mean. i just know it's a top lvl script environment. any idea?
2 Réponses
+ 5
it's what runs when you call the script, as far as I know. I don't use it often (though maybe I should!)
+ 2
__main__ is usually what is run on code runners.
__name__ can take on other names too