Rules Engine For Python Command To End Program