No video

What is Python's Main Function Useful For?

  Рет қаралды 75,153

NeuralNine

NeuralNine

Күн бұрын

In this video, we learn what the Python main function is useful for and how to use it.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер: 73
@expansivegymnast1020
@expansivegymnast1020 2 жыл бұрын
THANK YOU! This is one of those things people expect you to do but never explain why you have to do it. Like, I can understand that I have to have a main function but show me why and what happens when I don't.
@2ru2pacFan
@2ru2pacFan 2 жыл бұрын
That is crazy as I was typing 'what is if __name__ == __main__' on the search bar, a notification popped up and it was this video. What a coincidence 😂 thanks dude
@dogwithwatergun1546
@dogwithwatergun1546 2 жыл бұрын
Thats google cookies for you. Really useful but CAN be used for something else. I know it doesn't but it can.
@ninjacodertech
@ninjacodertech 2 жыл бұрын
google is spying on you...
@dogwithwatergun1546
@dogwithwatergun1546 2 жыл бұрын
@@ninjacodertech yes, but you're too boring for them to really look what you're doing.
@ninjacodertech
@ninjacodertech 2 жыл бұрын
@@dogwithwatergun1546 what is wrong with you
@dogwithwatergun1546
@dogwithwatergun1546 2 жыл бұрын
@@ninjacodertech google is spying on you... like yes its 2021, if you want privacy you should start by deleting youtube.
@Pogo_tC
@Pogo_tC 2 жыл бұрын
I have done a lot of reading and practicing in Python never could understand the dunder thing was and now it finally clicked for me. Thanks, man!
@alexander.starbuck
@alexander.starbuck Жыл бұрын
BRILLIANT! After watching at least 10 other tutorials, I FINALLY undersand this concept. Great teaching skills and great style, keep it up ;)
@CliffR
@CliffR Жыл бұрын
I’ve watched a few videos about this and by far you have the most clear understandable explanation
@wko_
@wko_ 2 жыл бұрын
Awesome! I had needed this in my project and I didn't know how to do it... Thanks again!
@holy5413
@holy5413 2 жыл бұрын
my mind just exploded, I see lots of people using it but never had seen someone explaining it, thanks a lot!
@CloseStudios
@CloseStudios Жыл бұрын
The best explaination I could find! Thanks a lot
@mohammedmusthafa959
@mohammedmusthafa959 2 жыл бұрын
Finally understood why we use it! Thanks Man!
@andrewjenson_original
@andrewjenson_original 10 ай бұрын
Thanks, I watched 5 other KZfaq videos on this topic and your video explained this topic the best.
@darkuncle77
@darkuncle77 2 жыл бұрын
You are the best teacher I have found. You are a genius. Thank you
@danlekosh
@danlekosh 2 жыл бұрын
YOU'RE TOO GREAT buddy, thanks for dissecting these python notions like that..
@vasilebordei4668
@vasilebordei4668 2 жыл бұрын
This video helped me a lot!! Thank you!
@johnztech1651
@johnztech1651 2 жыл бұрын
I like this man how he starts his videos and his explanaition. he looks fynny but serious. i expect more on python GUI
@benlong1062
@benlong1062 2 жыл бұрын
This was really interesting. Thanks!
@tylerlee2612
@tylerlee2612 6 ай бұрын
i understood this a lot more than what was discussed in the sc50 class! I need to find more simple, basic and vary beginner focused videos talking about how to structure these still though. Thanks for posting this though, it helped with a big part of the confusion on why we use these.
@Nircode
@Nircode 2 ай бұрын
I'm from Harvard CS50, intro to python programming, this video has helped me a lot. Thanks
@bookweerd
@bookweerd Жыл бұрын
Thank you this was the best explanation for this topic!
@vatsalgandhi93
@vatsalgandhi93 2 жыл бұрын
great help man!! appreciate it !!
@patriciodiaz2377
@patriciodiaz2377 11 ай бұрын
Thanks so useful! And so easy to understand
@MrCipek1221
@MrCipek1221 2 жыл бұрын
Thanks :) I just counted on that I could find a video with you explaining this :D
@rajkumar-zq4ov
@rajkumar-zq4ov 10 ай бұрын
Very nice and detailed explanation...thank you so much
@Billcasiopost
@Billcasiopost 10 ай бұрын
Exactly the answer I was after, thanks 👍👍
@seanredmond9212
@seanredmond9212 Жыл бұрын
yeah I agree with other comment - saw other videos on this topic and I think your explanation was best. thanks.
@tushermyth
@tushermyth Жыл бұрын
Thanks for this! :)
@emilioserrano7062
@emilioserrano7062 Жыл бұрын
beautiful, thanks a lot!!!
@berkant8074
@berkant8074 2 жыл бұрын
There is just one word to describe you guy : AWESOME.
@cylemmulo
@cylemmulo 2 жыл бұрын
Thank you so much!
@SiTheMon777
@SiTheMon777 Жыл бұрын
Great explanation 🔥
@ivanoliveirapsd1337
@ivanoliveirapsd1337 2 жыл бұрын
Great, help me to understand. Hugs from Brasil
@Rnjeazy
@Rnjeazy 7 ай бұрын
Thank you s so much!
@marcomoscoso7402
@marcomoscoso7402 Жыл бұрын
Best explanation of this in Yt
@naro108
@naro108 2 жыл бұрын
Great explanation
@user-hj2ed5pe6j
@user-hj2ed5pe6j 2 жыл бұрын
How are you calling myvalue as global variables at 6:03. When you use if ___name___ == '__main__' then myvalue is definitely not a global variable. You have to use *global myvalue* before defining it to make it global. The error is not at all confusing. Its pretty clear.
@disrael2101
@disrael2101 2 жыл бұрын
Ya i thought the same it's in if statement scope
@alejrandom6592
@alejrandom6592 2 жыл бұрын
Only if inside a function, otherwise its implied to be global
@chaks2432
@chaks2432 2 жыл бұрын
Bruh, are you reading my mind or something? Just got lectured on the Python Subreddit yesterday for not using Main on a script I posted there, lmao
@DubZenStep
@DubZenStep 8 ай бұрын
protect this man at all costs
@djeros666
@djeros666 Жыл бұрын
Dude! WTH dude! thank ****! much love bro thanks
@xolaninqubezelo3091
@xolaninqubezelo3091 Жыл бұрын
Great video.
@Menna23326
@Menna23326 Жыл бұрын
You are awesome!😃
@thatguythatdoesstuff7448
@thatguythatdoesstuff7448 3 ай бұрын
Something confusing to new learners is when you use .py names that are duplicative of non dynamic syntax. Calling the .py "main" when the if statement is not referring to the .py named main causes confusion. A new user will see that and attempt to change '__main__' to reference the .py they are trying to call the functions from. Otherwise, very good video.
@Franx570
@Franx570 2 жыл бұрын
Do the Nvim tutorial of the COC implementation or the new LSP of the Neovim 0.5 :(
@oguzhantopaloglu9442
@oguzhantopaloglu9442 2 жыл бұрын
can you do some tutorials of pillow?
@hicham_6544-_-
@hicham_6544-_- 2 жыл бұрын
What theme are you using in pycharm ,bro 🤔
@0verflowSec
@0verflowSec 2 жыл бұрын
Can you make video about Jython(Java + Python)
@rashmikaabeyrathna1017
@rashmikaabeyrathna1017 2 жыл бұрын
grate job
@malakarakesh3139
@malakarakesh3139 6 ай бұрын
at 6:09, `myvalue` was still undefined even though it was globally defined. why was it so?
@jromeroevo
@jromeroevo 2 жыл бұрын
Great tutorial. I do have a question. Don’t you need the keyword “global” to turn a variable into a global variable ?
@Anonymous-om5ql
@Anonymous-om5ql 2 жыл бұрын
Yeah...even I was thinking of that
@user-yd2ee6sf8k
@user-yd2ee6sf8k 2 жыл бұрын
no, it's just what we call the variable.
@sethadkins546
@sethadkins546 2 жыл бұрын
Only if inside a function, otherwise its implied to be global
@ninjacodertech
@ninjacodertech 2 жыл бұрын
ohhhhh this makes sense
@redserpent
@redserpent Жыл бұрын
excellent video. Tweeted.
@alonelay
@alonelay 2 жыл бұрын
so variable can't define as globally, but can define in local. And no error?
@bazzkiller1331
@bazzkiller1331 Жыл бұрын
Shouldn't the if __name__ == "__main__" expression be only inside the "main" script? Not in "mylibrary"...
@historyrogue5056
@historyrogue5056 2 жыл бұрын
please do a Cython tutorial , and a question , is Cython more practical to use than CPython?
@IzUrBoiKK
@IzUrBoiKK 2 жыл бұрын
Yes
@historyrogue5056
@historyrogue5056 2 жыл бұрын
@@IzUrBoiKK Do you use it? can it actually make python code run in C code speed?
@VeereshPatel15
@VeereshPatel15 2 жыл бұрын
Love ❤ for ur efforts and ur content In future I am expecting videos on Frontend roles and Responsibilities like 1. What actually do frontend developers do in realtime ( different tasks) 2.. How manage 4+ experience in realtime 3. . How to crack any frontend interviews with 4+ years of experience 4.....Easy way to to crack any angular/reactjs interviews with 4+ experience/10lack package ------) )) 5....Top 20 program's to cover entire angular/reactjs syllabus.----)) 6....Top 10 angular/reactjs concepts with examples
@philtoa334
@philtoa334 Жыл бұрын
Thx_.
@LucPOLO
@LucPOLO 7 ай бұрын
Bro, there are two possibilities, either you’re fucking genius teacher or others are terrible craps doing it. Whatever the answer is, as many others here i finally understood this concept after a few hours of unsuccessful researches.
@churchofclaus
@churchofclaus 2 жыл бұрын
🤯bro
@JarppaGuru
@JarppaGuru 2 жыл бұрын
for all main part lol
@sohankulkarni6560
@sohankulkarni6560 2 жыл бұрын
Is sumeet your Friend
@aditya_asundi
@aditya_asundi 2 жыл бұрын
first
If __name__ == '__main__' for Python Beginners
9:29
Indently
Рет қаралды 18 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 433 М.
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 4,6 МЛН
Опасность фирменной зарядки Apple
00:57
SuperCrastan
Рет қаралды 11 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 392 М.
Data Classes in Python Are The New Standard
20:34
NeuralNine
Рет қаралды 66 М.
5 Tips To Write Better Python Functions
15:59
Indently
Рет қаралды 99 М.
Python Tutorial: if __name__ == '__main__'
8:43
Corey Schafer
Рет қаралды 2 МЛН
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 109 М.
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 434 М.
Makefiles Make Your Life Easier
12:05
NeuralNine
Рет қаралды 91 М.
Functions vs Classes: When to Use Which and Why?
10:49
ArjanCodes
Рет қаралды 149 М.
Make Your Python Code More Professional
19:43
NeuralNine
Рет қаралды 62 М.
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Бискас
Рет қаралды 4,6 МЛН