How to run file as main file

Is it main file


def hello():# w  w w .j a v  a 2  s  . c o  m
    print "Hello, world!"

def test():
    hello()

if __name__ == '__main__': test()

The code above generates the following result.





















Home »
  Python »
    Language Basics »




Python Basics
Operator
Statements
Function Definition
Class
Buildin Functions
Buildin Modules