Hooray! We have a winner! Thanks Duncan. Your improved shell line will do the job very nicely. :) (btw, the problem with "import sethook" at the top of the script is that syntax errors in the top-level will prevent the import from being run meaning we don't get our traceback anymore.) Giles