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.
~
Run Python Online: https://www.programiz.com/python-prog...
Programs in this video: https://github.com/programiz/python-b...
Python if _name_ == "__main__" (text-based tutorial): https://www.programiz.com/python-prog...
Watch our videos and revise them with our Python App!
Download here for Android: https://bit.ly/learn-python-android
Download here for iOS: https://apple.co/3iPm6Sx
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:
Facebook: / programiz
Instagram: / _programiz
LinkedIn: / programiz
Website: https://www.programiz.com
#programiz #python #specialnameattribute #learnprogramming #runpythononline
Смотрите видео #8: Python if __name__ == '__main__' | Python Best Practices онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Programiz 21 Апрель 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 11,96 раз и оно понравилось 28 людям.