In this video, I show you how and why you should always use if _name_ == '__main__' in python and answer the question of why there is no Python main function. Additionally, you will see how to prevent Python modules from executing using Python __main__.
⏬ Python Cheat Sheets: https://k0nze.gumroad.com
👉 Website Article for this Video: https://k0nze.dev/posts/python-name-main
💌 Support me on Patreon: / k0nze
☕️ Buy me Coffee: https://www.buymeacoffee.com/k0nze
🌍 Check out my Website: https://k0nze.dev
💻 Join our Discord: https://discord.k0nze.dev
👔 Follow me on LinkedIn: https://linkedin.k0nze.dev
Recording Gear
Camera - Sony A6400: https://geni.us/zRw1
Lens - Viltrox AF 23mm f1.4: https://geni.us/RVrguGd
Microphone - Rode Wireless Go: https://geni.us/RBAOIx
Keyboard - Keychron K2 v2: https://geni.us/DPK87Xn
⏰ Timestamps:
0:00 Intro
0:17 Python does not have a main function
0:45 How does the Python interpreter work?
2:13 Prevent Python import from execution
2:33 Python _name_
4:14 Summary
Смотрите видео Why You Should Use Python if __name__ == "__main__" онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь k0nze 08 Март 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 23,219 раз и оно понравилось 972 людям.