calling functions style question

Brian bnblazer at
Tue Jun 6 17:23:30 CEST 2006

I just have a basic style question here.  Suppose you have the program:

def foo1():
    do something

def foo2()
    do something else

Assume that you want to call these functions at execution.  Is it more
proper to call them directly like:


or in an if __name__ == "__main__": ?

Both will execute when the script is called directly, I was just
wondering if there is a preference, and what the pros and cons to each
method were.


More information about the Python-list mailing list