[python] How to terminate a Python script