python 杀死自身进程的实现方法
时间:2021-05-18 09:43:23|栏目:Python代码|点击: 次
有时候我们需要中断程序的执行,比如执行如下代码失败时。
import tensorflow as tf tf.enable_eager_execution()

这时我们可以杀掉进程,重新执行上述代码
import os import signal os.kill(os.getpid(), signal.SIGKILL)
上一篇:Python线程指南分享
栏 目:Python代码
本文标题:python 杀死自身进程的实现方法
本文地址:http://www.codeinn.net/misctech/123728.html






