terminate
Terminate process associated with Python interpreter
Syntax
Description
terminate( terminates the process
associated with the Python® interpreter if the pe)ExecutionMode property of the Python environment is OutOfProcess. The function throws an error
if the property value is InProcess.
MATLAB® automatically removes standalone Python references from the workspace after you call terminate.
If you want to use Python again, the best practice is to immediately call pyenv with an
updated version value. If a MATLAB variable contains a Python reference, the Python reference becomes a deleted handle after you call
terminate. If you launch a new Python process, you can use pyenv to get information about it
and terminate to terminate it.
Note
Pressing Ctrl+C does not terminate the out-of-process command.