python
主页 > 脚本 > python >

python 杀死自身进程的实现方法

2019-07-02 | 秩名 | 点击:
本篇文章介绍python 杀死自身进程的实现方法

有时候我们需要中断程序的执行,比如执行如下代码失败时。

 
import tensorflow as tf
 
tf.enable_eager_execution()



这时我们可以杀掉进程,重新执行上述代码
 

 
import os
import signal
 
os.kill(os.getpid(), signal.SIGKILL)


原文链接:https://blog.csdn.net/xueruixuan/article/details/81100198
相关文章
最新更新