Can you give us a simple description of what you are trying to do? And if you can post in plain text instead of HTML that would be helpful. Maybe this will give you some ideas - you can trap the control-D and do your cleanup: http://openbookproject.net/pybiblio/tips/wilson/simpleExceptions.php Kent