A Module with Conditional Test Code : Module : Introduction PYTHON TUTORIALS


PYTHON TUTORIALS » Introduction » Module »

 

A Module with Conditional Test Code


# c:pythonhello.py
def hello():
    print "Hello, world!"
def test():
    hello()
if __name__ == '__main__': test()


# main.py
sys.path.append('c:/python')
import hello

hello.hello()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Introduction
» Module