結果 : how to exit python program gracefully