Python Tutorial - 15. if __name__ == '__main__'

preview_player
Показать описание

The python tutorial guides us about if “ __name__”==”__main__”. It will teach us what is “__name__” in python, how it is executed and how to execute python file from a command prompt.

Topics that are covered in this Python Video:
0:25 what is __name__
3:24 Execute python file from a command prompt

Next Video:

Рекомендации по теме
Комментарии
Автор

not sure why the sexy music, but thanks to your tutorial I finally understand the logic of __name__=="__main__"

jamelstringer
Автор

Found your tutorials today. They are realy great. Thanks a lot

w.schobel
Автор

I still did not understand logic and you did not explain why it's actually matter or relevant to include this statement in the end of python files?

davidusharauli
Автор

Thank you but I'm a little confused by you saying that main() is the entry point of a program. If for example I had a print statement as the first line of my program that would run even though it was not in the main (). So how is main() the entry point of the program when python is running the program from top to bottom?

westfield
Автор

So if a program imports another module and uses only functions from that module will __name__ equal the name of the imported module? What if multiple modules are imported?

RomanKnav
Автор

why caller.py dont show answer of area as it is return in function ?

samarth.create
Автор

What's the IDE used in this video..??.

abdulkhader
Автор

How do I enter in if __name__==main from caller .py?

AllWeNeedIsLove
Автор

D E S I G N A T E D
E
S
I
G
N
A
T
E
D
nice tutorial though thanks

beepboopbaplawl