*You can also run a script by right clicking within that script and selecting 'Run'. I forgot about that shortcut while filming this video.* if ___name___ == __main__: (this script can be imported OR run standalone) Functions and classes in this module can be reused without the main block of code executing Good practice (code is modular, helps readability, leaves no global variables, avoids unintended execution) Ex. library = Import library for functionality. When running library directly, display a help page # ---------- script1.py ---------- # This file can run standalone or be imported def favorite_food(food): print(f"Your favorite food is {food}") def main(): print("This is script1") favorite_food("pizza") print("Goodbye!") if ___name___ == '__main__': main() # ---------- script2.py ---------- # This file should run only standalone from script1 import * def favorite_drink(drink): print(f"Your favorite drink is {drink}") print("This is script2") favorite_food("sushi") favorite_drink("coffee") print('Goodbye!')
@kamranalizade986 ай бұрын
Hello my best developer and youtuber wassup man,will Laravel videos come?
@olivergrim76346 ай бұрын
all me python skill came from this guy! extremely well made videos!
@user-n6e8r6 ай бұрын
If bro code only has 1 follower...that's me If bro code has millions of followers... I'm one of them If bro code has no followers... I'm dead.
@SxitxmaNxB6 ай бұрын
As long as you follow him, it doesn’t matter if you’re dead, since it saves 👍
@BaldiReycaster6 ай бұрын
Nah... I'd be dead before subscribing
@_EnderTv6 ай бұрын
if ___name___ == "__main__": print("ok") else: delete system32
@SxitxmaNxB6 ай бұрын
That’s wrong, it has to be 2 underscores (__name__)
@_EnderTv6 ай бұрын
@@SxitxmaNxB yt italized the _ for absolutely no reason
@segevlavi37708 күн бұрын
DONT DO IT! as you can see in the code he wrote delete system and it will just delete ur system
@Little-bird-told-me6 ай бұрын
THis is the first time I actually understood why what this function used
@domination342812 күн бұрын
same here
@muhammadislam78366 ай бұрын
Bro i start your c++ 6 hours course, i follow all instructions but why my ming64 bin folder empty but your was not empty, also g++ --version command got error, i noticed ucrt64 bin folder have those files that were in your ming64 bin folder, so i give ucrt64 bin folder path that worked when i type g++ --version command,.also got first program output in vsc, when i give path ming64 bin when that time i got error in vsc when i output, i wanna ask is this ok giving ucrt64 bin folder path? becuase Ai gemini says maybe this worked but thats not good,pls reply😔
@c-ronos6 ай бұрын
1:35 how do i do that in vscode?
@vibingowsic23386 ай бұрын
Hey bro! Could you do springboot tutorials. Please
@technicalswag39256 ай бұрын
Sir please continue and complete the react course
@TamilCoder.6 ай бұрын
Thank you bro❤
@BaldiReycaster6 ай бұрын
:)
@Kartik-malviya6 ай бұрын
Can you please make a tutorial on Golang, i really wanna learn it from you!
@sammyay-man27544 ай бұрын
What happened if I moved the imported file to other folder ?
@SmortMen4 ай бұрын
すし Gud
@mintz3476 ай бұрын
can you please do spring boot series all aboput java fullstack?