#8: Python if __name__ == '__main__' | Python Best Practices

preview_player
Показать описание
Step by step video tutorials to learn Python for absolute beginners!

You might have encountered the statement if __name__ == "__main__" a lot while coding in Python.

In this video, you will learn about the special __name__ attribute of a Python file and how it can be used to run the file dynamically in different contexts.

~

Watch our videos and revise them with our Python App!

Timestamps:
0:00 Intro
0:16 What is __name__ in Python?
0:30 Running a Python File as a Script
1:34 Running a Python File as a Module
2:48 Using if conditional with __name__

Find Programiz elsewhere:

#programiz #python #specialnameattribute #learnprogramming #runpythononline
Рекомендации по теме
Комментарии
Автор

You're seriously underrated, brother!

guganesan.ilavarasan
Автор

Your channel and website is so great i wish you guys more success

zhanezar
Автор

Your videos have helped me significantly☺☺

jlee
Автор

Brother next topic :Django, plz do videos on Django

gotetilakshman
Автор

I Have Learned A lot About Programming and CS in the last few weeks....

I have also made soo many real-life projects like calculator, budget calculator, some programs to solve mathematical problems and many more things.

Should I Distribute these codes on github, stackoverflow etc🤔🤔
I would love to see replies...

lastonline