What Does if __name__ == "__main__" Mean in Python?

You’ve likely encountered Python’s if __name__ == "__main__" idiom when reading other people’s code. You might have even used if __name__ == "__main__" in your own scripts. But did you use it correctly?

This line of code can seem a little cryptic, so don’t fret if you’re not completely sure what it does, why you might want it, and when to use it.

In this video course, you’ll learn all about Python’s if __name__ == "__main__" idiom.


[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]


电子产品 排行榜


Gurmandise 哆啦A梦 铜锣烧 手机手环

IT電腦補習 java補習 為大家配對電腦補習,IT freelance, 私人老師, PHP補習,CSS補習,XML,Java補習,MySQL補習,graphic design補習,中小學ICT補習,一對一私人補習和Freelance自由工作配對。
立刻註冊及報名電腦補習課程吧!

facebook 查詢:
24 hours enquiry facebook channel :
https://www.facebook.com/itteacheritfreelance/?ref=aymt_homepage_panel

Be the first to comment

Leave a Reply

Your email address will not be published.


*