Possible Duplicate:
What doesif __name__=="__main__":
do?
What's the point of a main function and/or__name__ == "__main__"
check in Python?
I just wanted to understand why you have you use the __name__='__main__'
statement if we can run any python script even without using that statement.
For example, I can run the script below without using the if __name__='__main__'
statement.
def hello():
print "hello"
return 1234
# And here is the function being used
print hello()