How To End Automation In Python