+ 1
Why added to python program file ?
If_name_ ==“_main_”: main()
2 Antworten
+ 3
See this answer and btw it is double underscore
if __name__ == "__main__" :
https://www.sololearn.com/Discuss/2296422/?ref=app
+ 3
The __name__ variable is a special Python variable. It gets its value depending on how we execute the containing script. If we execute the original script it's value will be main but if we use this script from any other script it's value will be same as your original script's name