What does "if __name__ == '__main__' " do in Python?

  Рет қаралды 5,446

Python and Pandas with Reuven Lerner

Python and Pandas with Reuven Lerner

Күн бұрын

Пікірлер: 58
@funnyarian
@funnyarian Жыл бұрын
best explanation ever on youtube!!!
@ReuvenLerner
@ReuvenLerner Жыл бұрын
So happy to hear you liked it!
@Diamond_Hanz
@Diamond_Hanz Жыл бұрын
I've watched 5 videos, but yours in jupytrr notebook finally clicked for me since I use jupytrr notebook too. ty so much. sub and liked!
@ReuvenLerner
@ReuvenLerner Жыл бұрын
Delighted to hear that you enjoyed and learned - welcome!
@richpeacock
@richpeacock Жыл бұрын
Well, I never! I couldn't work this out until now. Thanks.
@ReuvenLerner
@ReuvenLerner Жыл бұрын
So glad to hear it helped!
@ThePeacefullOasis
@ThePeacefullOasis 2 жыл бұрын
So far best explanation I found on this topic. Thanks!
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Delighted to hear it!
@Anonymous_it_is
@Anonymous_it_is Жыл бұрын
Magnificent explanation Cleared all the doubts in such a simple manner. I recently came across your channel & have been hooked since then for python content. Request you to release OOPs concepts videos as well, would be really helpful to learn oops concepts from a teacher like you:) Thanks much sharing your knowledge
@ReuvenLerner
@ReuvenLerner Жыл бұрын
I'm so glad to hear that it helped!
@funnyclips2696
@funnyclips2696 2 жыл бұрын
Better at least ! This particular function: if __name__= __main__ has been very confusing to me. But, bit by bit I'm getting to see its relevance. Thanks
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Happy to know it's becoming clearer!
@davidbacon4963
@davidbacon4963 2 жыл бұрын
An excellent explanation. Thank you. A valuable time investment. Very well done.
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Delighted to hear it helped!
@BytesofNow
@BytesofNow 2 жыл бұрын
waw, this is one thing i never knew of, thank you Reuven
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad it helped!
@mbegaliful
@mbegaliful 2 жыл бұрын
thanks this was very helpful!
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad it helped!
@mbegaliful
@mbegaliful 2 жыл бұрын
​@@ReuvenLerner I particularly appreciated that you try to model the reasoning you need to develop to understand coding. Unlike many tutorials on youtube that just give you a recipe to do xyz.
@takshpatel8109
@takshpatel8109 2 жыл бұрын
I was confused by this for while , but thanks for the clarifying so well 😊😊. Thanks
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad it helped!
@PaulFWatts
@PaulFWatts 2 жыл бұрын
Very well explained! As others have said in the comments it's the best explanation I have found so far on this topic.
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
I'm so happy to hear it helped!
@enpassant7358
@enpassant7358 2 жыл бұрын
Excellent video! Clear, consice, and now I understand. Thanks!
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad you liked it!
@brachysm
@brachysm 2 жыл бұрын
Very logical and clear! Thanks!❤
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
My pleasure!
@anastasiiaandrusyshyna735
@anastasiiaandrusyshyna735 Жыл бұрын
thanks . so clear and helpful . best on this topic
@ReuvenLerner
@ReuvenLerner Жыл бұрын
Glad it helped!
@dhananjayhawal3102
@dhananjayhawal3102 2 жыл бұрын
Nicely explained
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Thanks; glad you liked it!
@0xhhhhff
@0xhhhhff 2 жыл бұрын
Thanks for the lesson. It was thorough and clear!
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad to hear it!
@QWin-ir6yq
@QWin-ir6yq Жыл бұрын
Nice vid. Like the way you explain
@ReuvenLerner
@ReuvenLerner Жыл бұрын
Thanks!
@santosharakere
@santosharakere 2 жыл бұрын
Excellent. Thanks.
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad you enjoyed!
@abschmit
@abschmit 8 ай бұрын
dunder
@ReuvenLerner
@ReuvenLerner 8 ай бұрын
Yes, indeed! I even heard someone jokingly say, a few years ago, that we should have *triple* underscore special methods, which we could call ... "thunder."
@theclimateposts
@theclimateposts 2 жыл бұрын
Thanks for this, excellent explanation, subscribed :)
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad you enjoyed it!
@kwaczorek007
@kwaczorek007 2 жыл бұрын
Great explanation. Any plans for similar C++ tutorials? ;)
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
The last time I used C++ was about 30 years ago. The world and I are both better off that I've avoided it since then!
@faseunoluwatobiloba6716
@faseunoluwatobiloba6716 2 жыл бұрын
Hey, thanks for this one more subscriber added i have been using python flask for a while and this line is very important but i didn't understand it
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
Glad to hear it; welcome!
@nateF888
@nateF888 2 жыл бұрын
Hey, thanks for the lesson! I have a question that i need a second opinion on. I just got in college taking Computer engineering. My career goal is to be a software developer, but I decided to pick computer engineering instead of comsci as it was more flexible in terms of job opportunities according to my research. I have already started learning programming before going to college. Currently we are on our 4th week of our classes and i am already bombarded with math and chemistry lessons. These past week i've been studying from morning to night for these two subjects, and i don't even think they're that necessary for my career goal as a software developer. I've seriously been thinking of dropping out, and self studying to be a software developer. I am disciplined and i will study for 8 hours if i have to. Can i get your opinion on this?
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
You can learn programming through self study, true! And many people have done it. So, why get a university degree? (1) Most people aren't disciplined enough to learn what they need in a reasonable amount of time. Having deadlines and structure increases the chance that you'll finish. (2) A university degree is basically a strong letter of recommendation, saying that you know your stuff. Some employers might not be willing to take a chance on someone who has self-studied. (3) A university education is typically deeper (including theory) and wider (on a variety of topics) than you're likely to learn yourself. For example, you don't need chemistry or math for programming, but some background in each will give you new ways to think about the world. You never know when you'll draw upon these topics, or the ways they help you to think, down the road. (Although I took chemistry in college, and they told us that learning solid-state chemistry would help us to understand semiconductors... that hasn't really played a role in my software career, I'll admit!) Note that there are many people who are disciplined, and learned both deeply and widely, and got fantastic jobs. No doubt about it! And if you cannot manage the university classes while you're also working, then you should indeed find another path to success. But I do think that a degree increases your chances of success, and of landing a good job. How much of an increase, I can't tell you. But it's something.
@mariom1417
@mariom1417 2 жыл бұрын
Basic engineering courses (calculus, physics, chemistry) teach you the base of most known science. I d take those at least.
@gerardob.3765
@gerardob.3765 Жыл бұрын
Great video
@ReuvenLerner
@ReuvenLerner Жыл бұрын
Thanks!
@zigaudrey
@zigaudrey Жыл бұрын
I never understand the purpose of the line if this is always True. Now, I understand. It isn't something nerd will add to make thing cool.
@ReuvenLerner
@ReuvenLerner Жыл бұрын
You're already cool if you're using Python. :-) But yeah, a *ton* of people don't really understand how it works, or what it does. Glad this helped!
@ShayanMK
@ShayanMK 2 жыл бұрын
Do you know how to make python main.py work
@ReuvenLerner
@ReuvenLerner 2 жыл бұрын
main.py is a bit weird, and I've personally never used it. But it's a different mechanism than this whole __name__ and __main__ business.
@cliffmathew
@cliffmathew Жыл бұрын
___great___
@jamescullins2709
@jamescullins2709 10 ай бұрын
What in the world is dunder?
@ReuvenLerner
@ReuvenLerner 10 ай бұрын
It's Python slang (sorry for not explaining it!) for "double underscore, before and after the name." So "dunder init" is "__init__". Typically, dunders in Python are names of variables and methods that Python looks for -- and if they're there, Python uses them. For example, if you define a __len__ method (i.e., "dunder len"), then your object supports the "len" function. Dunder methods are also called "magic methods." Here, we aren't talking about methods, but rather variables and names that Python sets behind the scenes to inform us about how the program was/is being run.
@jamescullins2709
@jamescullins2709 10 ай бұрын
OK, thanks, it makes sense now d under thanks I will remember that one.@@ReuvenLerner
Python identifiers - rules and conventions
15:45
Python and Pandas with Reuven Lerner
Рет қаралды 1,8 М.
Python and Unicode characters
13:10
Python and Pandas with Reuven Lerner
Рет қаралды 6 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,3 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 12 МЛН
#programming #coding #ezsnippet
0:05
Neeraj Walia
Рет қаралды 3,1 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 414 М.
Every Python dev falls for this (name mangling)
14:11
mCoding
Рет қаралды 139 М.
If __name__ == '__main__' for Python Beginners
9:29
Indently
Рет қаралды 21 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 815 М.
"import" vs. "from .. import" in Python: Which uses more memory?
7:02
Python and Pandas with Reuven Lerner
Рет қаралды 9 М.
Why You Should Use Python if __name__ == "__main__"
5:26
Understanding (and avoiding) the SettingWithCopyWarning in Pandas
8:11
Python and Pandas with Reuven Lerner
Рет қаралды 4,1 М.
What does Python's __init__ method do?
6:56
Python and Pandas with Reuven Lerner
Рет қаралды 34 М.
СДЕЛАЙ ТАК . Пульт будет работать вечно
9:39
Мужские интересы 79
Рет қаралды 84 М.
Review Máy Đếm Tiền Tính Tổng #shorts
0:26
Review Máy Đếm Tiền
Рет қаралды 7 МЛН
Лучший лайфхак для клавиатуры 🤡
0:57
ПРОСТО ЛЕШКА
Рет қаралды 2,8 МЛН
Making iPhone16 pink📱
0:34
Juno Craft 주노 크래프트
Рет қаралды 27 МЛН
😱Складных смартфонов больше не будет
0:46
ÉЖИ АКСЁНОВ
Рет қаралды 385 М.