[英]Run Jupyter notebook out of Jupyter environment
I have a Jupyter notebook containing python and R scripts as well as magic commands. 我有一个Jupyter笔记本,其中包含python和R脚本以及魔术命令。 What I need is to schedule a task using Windows Task scheduler that somehow triggers run of this notebook. 我需要的是使用Windows Task Scheduler计划任务,该任务以某种方式触发了此笔记本的运行。 My scripts run at night and I prefer Jupyter to be closed. 我的脚本在晚上运行,我希望关闭Jupyter。 So I wonder if there is a way to do this? 所以我想知道是否有办法做到这一点? Thank you in advance. 先感谢您。
It is perfectly possible to do this 完全有可能做到这一点
Create a bat file that you can reference in the windows task scheduler. 创建一个可以在Windows任务计划程序中引用的bat文件。
Code as follows: 代码如下:
cd C:\\path to your notebook jupyter nbconvert --to notebook --execute NOTEBOOKTOEXECUTE.ipynb
I needed to include the path, as the console would be run from the system path and thus unable to find the notebook. 我需要包括路径,因为控制台将从系统路径运行,因此无法找到笔记本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.