raghu raghu wrote:
i have a clarification regarding built in function,in some scripts it
is being used and it is give n: if _name_ == '_main_'
why this is being used in the scripts?
The global variable __name__ is equal to '__main__' when the python
script is run.
If the script is imported,
The global variable __name__ is equal to '__main__' when the python
script is run.
If the script is imported, __name__ is something other than '__main__'
(not sure what.)
it will be the name of your module. so for foo.py, if you execute it
(as a script), __name__ == '__main__', but if you