why a main() function?

beliavsky at aol.com beliavsky at aol.com
Mon Sep 18 21:40:00 CEST 2006


I think I read a suggestion somewhere to wrap the code where a Python
script starts in a main() function, so one has

def main():
    print "hi"

main()

instead of

print "hi"

What are the advantages of doing this?




More information about the Python-list mailing list