P
praba kar
Dear All,
I have doubt regarding main function in
Python. In Python we can create a function
and we can call a function directly.
(eg
def test():
print 'main function test'
I can call this function the following way
eg) test()
So why we need the below way of calling a
function?
if __name__ == '__main__':
test()
What is the advantage of this way calling a
function.
Kindly mail me as early as possible
regards,
Prabahar
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
I have doubt regarding main function in
Python. In Python we can create a function
and we can call a function directly.
(eg
def test():
print 'main function test'
I can call this function the following way
eg) test()
So why we need the below way of calling a
function?
if __name__ == '__main__':
test()
What is the advantage of this way calling a
function.
Kindly mail me as early as possible
regards,
Prabahar
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony