Handles system exit in main loop exception handler

I've never read a line of python so please forgive me if this really isn't the way to fix this!

Great work by the way. My daughter loves this. :-)