#46 Python Tutorial for Beginners | Special Variable __name__

  Рет қаралды 470,573

Telusko

Telusko

Күн бұрын

Пікірлер: 269
@nishthasrivastava9625
@nishthasrivastava9625 3 жыл бұрын
Summary of this video 1-They are two modules name demo and calc 2- when you are working on demo and print(_name ) Output- _main_(because it is starting point of a code) 3- Now we will work on calc and print hello _name_ Output- hello _main_ This is happening and it is giving name as main output because we are working on same module Now when we import one module to other ( import calc to demo) 1- All the things in calc will be printed along with demo statements 2- but it will print hello calc (the module name ) Instead of hello main Because we are importing it to other module "sooo when you are importing it in same module it will give name output as main And if in other module it will give name output along with module name...... that's it❤ Thanku sooo much sir great work Lots of blessing by one of your alien😅❤
@srijanmishra2447
@srijanmishra2447 Жыл бұрын
I reached till this video and while this video and last video 3 times then I understand about module and library as module this is beauty, I don't whether you reply or not but please tell me if I watched all python lectures and revise it, will I able to known s programmer
@jananivamp
@jananivamp 8 ай бұрын
@@srijanmishra2447 you need to practice it with real world applications
@jedits7835
@jedits7835 5 ай бұрын
@@srijanmishra2447 what are u doing now
@arjunyadav-kt5jr
@arjunyadav-kt5jr 5 жыл бұрын
guys u need to watch it more than once, he is crystal clear.
@technologyandinnovation4586
@technologyandinnovation4586 4 жыл бұрын
stop kissing up to him. It is free so we tolerate lower standard of teaching. The video has echo, he talks fast makes mistakes in method of teaching (see the number of edits), and fails to meet teaching standard for not to use a name with similar sounding names in a echo room i.e. "name" and "main".
@_.sunnyraj._
@_.sunnyraj._ 4 жыл бұрын
@@technologyandinnovation4586 🙁
@karruramesh9798
@karruramesh9798 4 жыл бұрын
@@technologyandinnovation4586 sir is crystal clear
@debjanighosh7875
@debjanighosh7875 4 жыл бұрын
@@technologyandinnovation4586 you r jealous..
@SupriyaMondal3
@SupriyaMondal3 4 жыл бұрын
​@@technologyandinnovation4586 yet I can understand what he is teaching. have you ever watched MIT free course channel? how their video and audio quality is not so good, as per your logic that is also low standard LOL!!
@thebrothershow5826
@thebrothershow5826 4 жыл бұрын
best video i'have ever seen about __name__ == "__main__",i don't understand why people can't uderstand the video,it was really clear
@IamNavi7
@IamNavi7 4 жыл бұрын
i don't know whether you will ever read this comment or not. But Bro , you are the only reason i could learn python in this efficient way. You are crystal clear in every topic and your delivery skills are on another level. I had watched many other videos also but no one was able to replace yours. You are awesome!
@dhruvsovasaria
@dhruvsovasaria 3 жыл бұрын
Now that you've learnt python , can you tell me how has it helped you?
@anushagloryi8350
@anushagloryi8350 Жыл бұрын
In which to do this coding could you intimate
@abhijeetkumar2204
@abhijeetkumar2204 5 жыл бұрын
Watched this 3 times finally understood ... thank you sir.u r one of the best teacher.
@Jaysalm
@Jaysalm 4 жыл бұрын
Once you watch it a couple times it really starts to make a lot of sense. Thank you
@chingyee2804
@chingyee2804 4 жыл бұрын
after so many videos and forums about __name__ and __main__, finally this video let me understand clearly what is it and what it does. Thanks!
@mohinulislammohin7741
@mohinulislammohin7741 3 жыл бұрын
You've beaten my instructor and made my concept clear. Gratitude.
@EUCitizenFedUpWithAllThisCrap
@EUCitizenFedUpWithAllThisCrap 3 жыл бұрын
Really, brilliant brilliant explination. Love your flow, very easy for my brain to follow.
@premprasad3511
@premprasad3511 Жыл бұрын
This is the clearest explanation of name, main I have seen anywhere. Thank you
@anugupta3727
@anugupta3727 4 жыл бұрын
So, I was wondering from months , why do we use it. Today , my doubt got cleared finally . Thanks telusko
@janosszeman9905
@janosszeman9905 5 ай бұрын
After watching 3-4 videos about it, I finally get it! Your explanation is very clear and understandable. Thank you very much!
@zakiasmaa6834
@zakiasmaa6834 2 ай бұрын
In Python, __name__ is a special variable that tells you if a script is being run directly or if it's being imported into another script. How It Works When a script is run directly: __name__ is set to "__main__". When a script is imported: __name__ is set to the script's name. Thanks a lot Sir 🥰
@pavanjain2178
@pavanjain2178 6 жыл бұрын
Sir i think one more video is required for __name__ to get it clearly understood so plz sir give something practical about it thankyou sir
@lovekumar7622
@lovekumar7622 6 жыл бұрын
Yes sir ✋
@hariprasadcb
@hariprasadcb 4 жыл бұрын
you should give two _ at each side
@Lanxxe
@Lanxxe 4 жыл бұрын
@@hariprasadcb He did but two were misinterpreted by KZbin and put name in italics
@sumanth5087
@sumanth5087 4 жыл бұрын
__name__
@diahidvegi8536
@diahidvegi8536 5 жыл бұрын
watched it 3 times, it's crystal clear now
@jonesleung6127
@jonesleung6127 3 жыл бұрын
Incredible tutorial that just absolutely drove the concept right into my head, loved the explanation and the example - this made me have that light bulb moment where I was like "oh wow, so this is what it's all about!"
@RahulGupta-ly2uu
@RahulGupta-ly2uu 6 жыл бұрын
sir u stopped giving the quiz questions at the end of the video.
@sufiyanmogal1527
@sufiyanmogal1527 2 жыл бұрын
thank you so much sir great explanation
@mypotm
@mypotm 4 жыл бұрын
His video is crystal clear to me, only because I came from Java background. The main method being the point of execution , and the need to create a function in the main file to prevent unwanted access to the main file by other files But to the Python background users, I do not think this is clear enough for them. Because I learnt python before Java and I did not understand it before, only understand it after I learnt Java
@plabonkumersarker
@plabonkumersarker 3 жыл бұрын
I understand it now! Thank you genius! You explanation is so cool ❤️
@tumul1474
@tumul1474 4 жыл бұрын
wow man ! you make things crystal clear
@dishankshah5080
@dishankshah5080 6 жыл бұрын
Getting confuse.make one more video on __name__.
@rajagladson4477
@rajagladson4477 5 жыл бұрын
Yes bro
@tushargoyaliit
@tushargoyaliit 5 жыл бұрын
@@rajagladson4477 exactly
@pokemongo8317
@pokemongo8317 5 жыл бұрын
One more clear video sir
@rajeshraut2955
@rajeshraut2955 5 жыл бұрын
Yes so confusing
@pokemongo8317
@pokemongo8317 5 жыл бұрын
Haha...don't hurry follow the playlist he already made another clearly
@parikshithishiker3880
@parikshithishiker3880 3 жыл бұрын
Thank You for all the efforts that you've made to make this video. This is a very helpful and informative video and I was able tot understand everything clearly. It also helped me perform better in school.
@glenfernandes898
@glenfernandes898 2 жыл бұрын
Your explained this concept in a very simple manner
@jagrutnimmala6087
@jagrutnimmala6087 2 жыл бұрын
This video is very clear. Thank you so much Naveen. You are helping a lot of guys like me. Thanks
@lucifercoxi8324
@lucifercoxi8324 3 жыл бұрын
just randomly found ___name___ == "__main__" , now got know the use, sir u made it easy peasy😀
@stealmil
@stealmil 8 ай бұрын
i dont find it in this video wtf you say bruh ?
@mnk4utube
@mnk4utube 3 жыл бұрын
Sir, its understandable, no need of new video on this topic. I too was bit confused initially but watched again, understood. One can try last minute program n understand. If name is main, then only execute main otherwise if its imported as a library in second module, then main function will not be executed ... that's it... :)
@legend7890
@legend7890 4 жыл бұрын
It was confusing at first so I had to watch it multiple times to understand. Understood the concept, thanks
@tinajain7295
@tinajain7295 2 жыл бұрын
The videos are very helpful and informative videos sir and that is the only reason I could learn python in this efficient way.Thank You sir.
@b.sasikumar2141
@b.sasikumar2141 4 жыл бұрын
I'm enhancing by watching one by one video sir that's really great explaining....👍👍
@AliRaza-dq3gc
@AliRaza-dq3gc 5 жыл бұрын
Hello this video was very helpful im not confused at all! Also i figured out the problem thanks :)
@adarshmelodies
@adarshmelodies 4 жыл бұрын
In short.... __name__ gives name of file it is in ("calc", "utils" etc....) except, when it is in the file which is being executed first, it gives "__main__" instead. we can use this property to our advantage to customize few lines to execute only if it is executing first.
@ernestogarcia5762
@ernestogarcia5762 2 жыл бұрын
Very clear and direct, thank you
@more_u-listen_more_u_love9543
@more_u-listen_more_u_love9543 6 жыл бұрын
Hello Sir, This is my main function ( demo.py)................................ class Computer: def __init__(self, name, age): self.name = name #Assigne the value to the object self.age = age def myfunc(self): print("Hello my name is and age is ", self.name,self.age) p1 = Computer("John", 36) p2= Computer("Soumen",25) p1.myfunc() p2.myfunc() if __name__== "__myfunc__": myfunc() This my cal function........................................ import demo print("This my first code which I wrote") if I call the cal function then why its print the demo.py result also ?
@manjunathmaddala7246
@manjunathmaddala7246 4 жыл бұрын
Bro first of all your code is wrong you are calling p1.myfunc( ) anf p2.myfunc( ) out side the condition and how can expect it not to print them in your cal module. So keep those p1.myfun and p2.myfunc in the if condition, the your code will work properly.
@preethamm.n1161
@preethamm.n1161 5 жыл бұрын
💞💞💞💓Awesome sir Ur my inspiration my hero 👏👏👏🌹🇮🇳🌟
@harisht46
@harisht46 5 жыл бұрын
It's been 3 days since I was trying to understand this concept but I'am getting confused. This is the first concept where I felt really hard to understand so far during my python course.
@53Strat
@53Strat 3 жыл бұрын
Could not comprehend this from my book. Thanks for the explanation!
@Imran20091990
@Imran20091990 2 жыл бұрын
Watching 3rd time.. got the concept.. awesome.. thanks....
@iamniks
@iamniks 4 жыл бұрын
i totally understand the use of __name__ , don't know why some people can't understand this easy concept
@qc7511
@qc7511 5 жыл бұрын
OOfff man, you saved me. Thank you so much for your video, this was really useful for me ! I'm now suscribed.
@shritishaw7510
@shritishaw7510 3 жыл бұрын
beautifully delivered... thanks a lot
@vivekmishra1703
@vivekmishra1703 2 жыл бұрын
very helpful video
@amberpradhan2484
@amberpradhan2484 3 жыл бұрын
You are excellent sir ! Thanks alot!
@srimanikandaprasaths2522
@srimanikandaprasaths2522 3 жыл бұрын
This Man is awesome...Thank you for your good work. as simple as that...
@Jarrod_C
@Jarrod_C 4 жыл бұрын
I wish you had more use cases for why this is useful and how it is used with more examples.
@Dileep-bb3uq
@Dileep-bb3uq 5 жыл бұрын
i understood that __name__ variable is used to prevent the leakage(i.e avoiding direct execution when we import) of code from the file which we are importing to another file
@ram54321
@ram54321 3 жыл бұрын
great video
@akshaybagalkotkar7833
@akshaybagalkotkar7833 3 жыл бұрын
Understood perfectly
@mnk4utube
@mnk4utube 3 жыл бұрын
I watched other youtube videos too on this topic, trust me, no one can make you understand better than our Naveen sir... :) Hats off to you sir... Just ignore negative people's comments and keep teaching your loving "Aliens" :)
@Md_hassan636
@Md_hassan636 Жыл бұрын
I don't know whether you will ever read this comment or not. but you are great bro i'm watching your video 4 years later after you have uplode
@Alberta_Farmer
@Alberta_Farmer 2 жыл бұрын
Amazing as always!
@vishalpatil7994
@vishalpatil7994 4 жыл бұрын
thank you sir ps: where ever you are not getting things by searching on goole append one more things to the search string navin reddy or tulusko you will definately understand the things if sir have recorded video on that
@kr.jay2094
@kr.jay2094 6 жыл бұрын
awesome trick
@sakshipoojary2000
@sakshipoojary2000 4 жыл бұрын
Iam watching python videos because of you sir
@flamboyantperson5936
@flamboyantperson5936 6 жыл бұрын
I did not understand anything in this video. It was very confusing I went to sleep really. All other videos are awesome and I have liked each and every video except this. Please clear this concept again. Thank you.
@GOWTHAMKANYADHARA
@GOWTHAMKANYADHARA 2 ай бұрын
Slow down the video speed to 0.5x speed and skip back repeatedly if you don't understand anything coming out from his mouth. Use Pycharm and experiment it with his tutorial. Then you will understand.
@juanbravo5315
@juanbravo5315 5 жыл бұрын
Clear as always! thanks you for this kind of content :)
@Ilovequran105
@Ilovequran105 4 жыл бұрын
You are a SAVIOR !!!! Whenever i dont understand something i come to your videos !!
@namanvijay3514
@namanvijay3514 4 жыл бұрын
superp explaination
@hydaromar6532
@hydaromar6532 4 жыл бұрын
Mashallah great video.
@mr.student5805
@mr.student5805 4 жыл бұрын
Radhe radhe
@mdahanaf
@mdahanaf 6 жыл бұрын
you are such a great teacher . respect you sir
@054_ritesh3
@054_ritesh3 4 жыл бұрын
Very sharp
@amandeepsaha
@amandeepsaha 2 жыл бұрын
It was helpful sir Thankyou
@GraphicalBoss
@GraphicalBoss 2 жыл бұрын
Great way to explain it! I watch like 2 videos before this one and I was more confused than when I started. lol Thank you sir. Bravo
@prasannabiswas2727
@prasannabiswas2727 6 жыл бұрын
This is the only place I understood the special variable.
@simondolapo1567
@simondolapo1567 2 жыл бұрын
Placed my two hands on my heads and shouted "wow"
@learnMore01234
@learnMore01234 Жыл бұрын
provide all lecture Hindi also
@EUCitizenFedUpWithAllThisCrap
@EUCitizenFedUpWithAllThisCrap 3 жыл бұрын
Great explination!
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius.
@sam.mankar
@sam.mankar 4 жыл бұрын
Sir I enjoyed the video and understood the concept at first sight(I just needed to practice on my laptop) . Crystal clear
@cdevagiri
@cdevagiri 3 жыл бұрын
Thank you so much. Very clearly explained
@robinrai341
@robinrai341 5 жыл бұрын
thank u so much sir,, i am impressed your teaching style,,, plz sir can u make a tutorial for django python
@prem9469
@prem9469 4 жыл бұрын
sir as usual loved ur videos, but sir give us assignment questions or mini projects so that we can improve more
@kenjik6029
@kenjik6029 3 жыл бұрын
You are awesome thanks
@asishraz6173
@asishraz6173 4 жыл бұрын
Understood it very nicely and experimented in many ways. Great video sir. Feeling motivated and going to watch next video.
@gautamgovinda5140
@gautamgovinda5140 3 жыл бұрын
nice explation
@khalifa2080
@khalifa2080 2 жыл бұрын
Thank you from Pakistan
@madhuks9053
@madhuks9053 4 жыл бұрын
even my teachers can't teach in this way very good ...
@MsHumayun123
@MsHumayun123 4 жыл бұрын
Navin bro I luv you...you changed my life😊👍
@0xN1nja
@0xN1nja 3 жыл бұрын
you explained better than codewithharry
@anirbanc88
@anirbanc88 2 жыл бұрын
this was awesome!
@rajkapadia247
@rajkapadia247 6 жыл бұрын
Amazing content man. Keep up the good work.
@sunilkumarreddy6537
@sunilkumarreddy6537 5 жыл бұрын
hello sir i'am getting some confuse pls guide me this lecture, Thank you........
@bsmaheshkumar5328
@bsmaheshkumar5328 4 жыл бұрын
It is the damn clear explanation... Thank you, sir.
@AnilKumar-ss5qz
@AnilKumar-ss5qz 4 жыл бұрын
Super explanation
@nikhilnambiar6811
@nikhilnambiar6811 3 жыл бұрын
Bro you r awesome... 🤩🤩🤩🤩.. I like you way of explanation ❤️...
@sambit98
@sambit98 2 жыл бұрын
Mind = Blown
@Squash101
@Squash101 3 ай бұрын
This isn't really all that confusing, simply a bit of time to think about it. In essence, when ever you run a file with _name_ it will print out _main_ since the file you're running is the ''main', but when _name_ is called from within a different file with import then it print out the name of the file every time. to stop the name of the file and code within the import file from being printed printed we simply put a conditional saying if _name_ = "_main_" then allow for the execution of the functions within so the import file never runs on your main file.
@amaansiddiqui8947
@amaansiddiqui8947 4 жыл бұрын
I didn't understand why people are not able to understand the crystal clear logic.
@chetansoni8620
@chetansoni8620 4 жыл бұрын
thanks for explaining sir....
@Schdid
@Schdid 3 жыл бұрын
still very useful today thank you
@kirubababu7127
@kirubababu7127 3 жыл бұрын
You are Awesome 🔥
@ImJhon-jr5tn
@ImJhon-jr5tn 4 жыл бұрын
A mystery man ❤ great man 🤝
@faiyaz7697
@faiyaz7697 4 жыл бұрын
Sir, would you please be able to go through every video of yours in this Python series and wherever you have mentioned that you will about this(that particular thing/topic) later, would be able to make videos on that topics about which you said that you will talk about it later and include them in this series ?
@mohdimrankhan3293
@mohdimrankhan3293 4 жыл бұрын
you are awesome
@smdash2920
@smdash2920 3 жыл бұрын
I think what people miss is... The fact that how YOU ENTER INTO THE PROGRAM! for the people this isn't making sense need to understand, the entry into your program. In other languages, the concept is a bit different yet the idea is same
@jadia
@jadia 5 жыл бұрын
I had to watch this video 3-4 times to understand but at last I understood. :)
@keshavrao3751
@keshavrao3751 5 жыл бұрын
YOu are awesome but very fast and very simple examples
@simpleandeasy7289
@simpleandeasy7289 2 жыл бұрын
TQ so much sir
@SumitSinghzz
@SumitSinghzz 3 жыл бұрын
Sir when you said welcome back 'aliens' it feels main dusre brhamand se aaya hun😁
@chinmaydas4053
@chinmaydas4053 6 жыл бұрын
Sir we did not get videos in last few days due to your illness.. Sir you be always in good health.. Our prayers for you to God.. 🙏🙏🙏..
#45 Python Tutorial for Beginners | Modules
7:20
Telusko
Рет қаралды 629 М.
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
#43 Python Tutorial for Beginners | Filter Map Reduce
11:34
Telusko
Рет қаралды 590 М.
Python if __name__ == '__main__' ❓
5:41
Bro Code
Рет қаралды 36 М.
#50 Python Tutorial for Beginners | __init__ method
6:46
Telusko
Рет қаралды 672 М.
If __name__ == '__main__ ' in Python | Python Tutorials for Beginners #lec110
21:44
#44 Python Tutorial for Beginners | Decorators
7:33
Telusko
Рет қаралды 610 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 412 М.
#64 Python Tutorial for Beginners | MultiThreading
14:45
Telusko
Рет қаралды 443 М.
Python Tutorial: if __name__ == '__main__'
8:43
Corey Schafer
Рет қаралды 2 МЛН