What is the difference on exit() and sys.exit() when called in the main body of a script? From the command line they seem to have the same effect. Aside: Just used a python dictionary in which the keys were compiled regular expressions. Provided a very elegant solution. Have to love it.