I've added the try..except block. Do you also want to quit using sys.exit or print is enough?