Mega Code Archive

 
Categories / Python Tutorial / Introduction
 

A Module with Conditional Test Code

# c:\python\hello.py def hello():     print "Hello, world!" def test():     hello() if __name__ == '__main__': test() # main.py sys.path.append('c:/python') import hello hello.hello()