if __name__ == “__main__” in Python Tamil #python #learnpythonintamil #programminglanguage

preview_player
Показать описание
Join this channel to get access to perks:

In this video, I’ll show you

if _name_ == "__main__" in Python. _name_ is a built in variable in Python. the value of _name_ is set to "__main__" at runtime. Each module has a name, and this name can be used to access instructions in a module. This is especially useful in a given situation: As mentioned before, the main block of a module is executed when it is imported for the first time. But what do we do if we want the block to run only if the module was started as a stand-alone program, but not if it was imported from another module? We can do this by evaluating the attribute _name_ of the module.

Enjoy!

Like

Share

Comment

Subscribe

#சங்கேமுழங்கு

Follow me:
******************************************************************
Instagram : Sanke_Muzangu
Twitter: @Sanke_Muzangu
*****************************************************************
Рекомендации по теме
visit shbcf.ru