On Thu, 27 Nov 2008 17:58:55 -0800, Asun Friere wrote:
> if __name__ == '__main__' : > import sys > sys.exit(main(sys.argv)) > > Doesn't this just pollute the namespace with main()? Agreed. I don't see anything wrong with that. You have one function more than you otherwise would have had, and you get the benefit that after importing the module, you can say module.main(myargs) to run the code just as if you had run it from the command line. In other words... in my opinion, writing a non-trivial main() function is the right thing to do. -- Steven -- http://mail.python.org/mailman/listinfo/python-list