How To Stop A Python Program Mid Function