Комментарии:
This is the simplest and clearest explanation I've come across for this. Thank you!
ОтветитьHey do you have any course on udemy for python
ОтветитьOr you can remove the method call in Script1, import in Script2 and call the do_something() function from there.
ОтветитьWell_paced explanations...
ОтветитьBro Your the best
ОтветитьNice fact
ОтветитьI need the name of that theme please
ОтветитьThat’s a very useless example
Ответитьwatched a few other videos of this topic and yours was the most simple to understand, thank you!
I wish you had a full Python course video, would love to watch you guide us through from the very basic beginnings to more complex stuff in Python.
all the 30 min videos and this was the best
ОтветитьThanks, Awesome crystal clear explanation
ОтветитьThanks a lot. Got it now.
Ответитьthis was the explanation i needed. thank you
Ответитьor you could simply not call the function in the module from which you import? can someone please explain to me why is it needed? I guess I know what it does, syntax and whatnot but simply put, if youre not calling the functions/methods in not main module, why would you even use it when it doesnt run automatically?
Edit: okay I see it, useful only when you need to use it as a standalone script for testing so you can have bunch of function calls ready at hand otherwise no need if you aint calling it and why would you even call it or make print statements there since thats whats main module for
this is the third video on _name_ that i watched and it was the icing on the cake. i now fully understand what the purpose is, thank you so much!!!!!!!!!!!!!!!!!!
ОтветитьI don't get it. You're calling the function in both files but you only want it to run in one? What's the point of that? When would you ever need this?
Point is, any code you want to run in only one file should only be written in that file. This can be applied similarly to variables knowing their own name.
i have a dumb question.
why dont just remove " do_something() "
Simple and useful explanation. Thanks. :)
ОтветитьI wish there was a keyword for this. *if "__name__" == "__main__":* is just such an eye-sore.
Ответитьikd python but wouldn't it be easier to add a guard clause before the "main execution" testing if it's NOT "__main__" and exiting if that's the case? so that your code isn't all indented
Ответитьnee alutham lae
ОтветитьBro you are awesome
Ответитьthat is super simple. Really amazing!
ОтветитьWhen you learning, sometimes you just need little videos to have a whole new understanding of what you're doing :D thank you so much
ОтветитьWhy wouldn't you remove the call to do something in script1 instead? Well I guess there are other real life complex situations where this is useful. Thanks it was straightforward
Ответитьgod, i have finally understood it
ОтветитьAs a beginner, i am confused fr
ОтветитьWhat theme do you use for VSCode? It looks so good
Ответитьamazing..! Thank you for the video!
ОтветитьI wish i saw this video LAST NIGHT when I was doing my homework and could not for the life of me figure out how to not get my code to run twice... well you live and you learn lmao
ОтветитьInteresting . . . .
Ответить100% i'm not gonna put this in ALL my scripts. i'm going to make sure to only use them in scripts that need to be imported
ОтветитьWhat theme are you using on vscode?
Ответитьgawd I love you
ОтветитьWhich Font are you using?
ОтветитьI watched several videos yet still don't understand. my low iq
ОтветитьPossibly the most concise and clear explanation of this variable!
ОтветитьFinally. A very simple yet straightforward explanation. Thank you
Ответитьfinally! an explanation to the use not complicated mechanism!
ОтветитьC L E A N E S T 🔥🔥🔥🔥🔥🔥🔥🔥🔥
ОтветитьShort and sweet,thanks
ОтветитьIncredible
Ответитьthank you!
Ответитьty
ОтветитьI think main guards are good to implemented in every script.
ОтветитьFor anyone wondering "Dunder" means double underscore
ОтветитьMy question is how are you getting Python to output under Output and not the Terminal?
Ответить