当我想做的事情结束时,我想以编程方式停止Google Colab笔记本,我想在末尾放一行来阻止它运行。我已经尝试过这些,但没有任何效果。它们都会重新启动而不是关闭或只是给出错误。
我从这里得到这些:
import os
os.kill(os.getpid(), 9)
Run Code Online (Sandbox Code Playgroud)
import sys
sys.exit()
Run Code Online (Sandbox Code Playgroud)
exit()
Run Code Online (Sandbox Code Playgroud)
quit()
Run Code Online (Sandbox Code Playgroud)
!kill -9 -1
Run Code Online (Sandbox Code Playgroud)
有一个结束所有运行时的快捷方式(默认情况下它是未定义的,我将其添加为Ctrl+ Shift+ K),所以也许我可以编写一个程序来虚拟地键入这些键。但它在关闭之前会打开一个弹出窗口,我可能无法在那里确认。
我怎样才能做到这一点?谢谢!
我正在关注本教程:https://www.youtube.com/watch? v=iWUR04B42Hc ,我知道它的内容已过时,但我认为已将其正确翻译为最新版本的Webpack,但它给了我这个错误configuration.module.rules[0] has an unknown property 'query'.
完整版
[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.module.rules[0] has an unknown property 'query'. These properties are valid:
object { assert?, compiler?, dependency?, descriptionData?, enforce?, exclude?, generator?, include?, issuer?, issuerLayer?, layer?, loader?, mimetype?, oneOf?, options?, parser?, realResource?, resolve?, resource?, resourceFragment?, resourceQuery?, rules?, scheme?, sideEffects?, test?, type?, use? }
-> A rule description with conditions and …Run Code Online (Sandbox Code Playgroud)