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
Auf dieser Seite können Sie das Online-Video #8: Python if __name__ == '__main__' | Python Best Practices mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Programiz 21 April 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 11,965 Mal angesehen und es wurde von 285 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!