On Wed, Aug 11, 2010 at 11:06 PM, James Mills <prolo...@shortcircuit.net.au> wrote: > On Thu, Aug 12, 2010 at 1:42 PM, Bill Allen <walle...@gmail.com> wrote: >> I have only learned a couple of ways to cause a Python program to exit: >> sys.exit(0) & raise.SystemExit . I am using this in a try/except block. >> Which is preferred? Are there other, better ways? > > The normal pattern is to have an entry point and an exit point. > > main() and SystemExit exception. > > cheers > James >
I usually just have the top of the program as entry point, and the bottom as exit. I like the simplicity. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor