简体   繁体   English

如何设置ipython jupyter笔记本的单元格?

[英]How do I cron an ipython jupyter notebook's cells?

I have an ipython jupyter notebook that I've developed and run from Django 1.8 with: 我有一个从Django 1.8开发并运行的ipython jupyter笔记本,其使用:

manage.py shell_plus --notebook

Within the notebook I have written some data analytics and reporting modules that produce CSV and HTML output via petl and pandas. 在笔记本中,我编写了一些数据分析和报告模块,这些模块通过petl和pandas生成CSV和HTML输出。

I'd like to automate the notebook in such a way that I can simply cron the notebook cells to execute and then serve the static HTML output, but I don't see a way to run the cells within the notebook without a human driving the process, ie from cron. 我想以这样一种方式来自动化笔记本电脑:可以简单地将笔记本电脑的单元格执行起来,然后提供静态HTML输出,但是我没有看到一种无需人工操作即可运行笔记本电脑内的单元格的方法。过程,即来自cron。

Nbconvert has a --execute flag to run a notebook before converting it to another format. Nbconvert有--execute标志将其转换为另一种格式之前运行的笔记本电脑。

So for instance, to run a notebook and convert to static HTML: 因此,例如,要运行笔记本并转换为静态HTML:

ipython nbconvert --execute --to html MyNotebook.ipynb

If you want to run it and save the results as an ipynb file, you can use --to notebook . 如果要运行它并将结果保存为ipynb文件,则可以使用--to notebook

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式将单元格添加到 IPython 或 Jupyter 笔记本? - How can I programatically add cells to and IPython or Jupyter notebook? 如何从 IPython shell 执行 Jupyter notebook? - How do I execute a Jupyter notebook from an IPython shell? 如何在 IPython (Jupyter) Notebook 的远程机器上添加 kernel? - How do I add a kernel on a remote machine in IPython (Jupyter) Notebook? 如何获取当前的 IPython / Jupyter Notebook 名称 - How do I get the current IPython / Jupyter Notebook name 如何在 Jupyter Ipython / JupyterLab notebook 中注释掉多个单元格? - How can I comment out multiple cells in Jupyter Ipython / JupyterLab notebook? 如何在 jupyter notebook 中制作带有可点击单元格的表格? - How do I make a table with clickable cells in jupyter notebook? 如何清除ipython笔记本列表中的陈旧条目? - How do I clear stale entries in ipython's Notebook list? 如何在不使用ipython的情况下配置jupyter笔记本以使用某些导入来预加载单元格? - How do I configure jupyter notebook for having a pre loaded cell with certain imports without using ipython? 如何在浏览器中增加 Jupyter/ipython 笔记本的单元格宽度? - How do I increase the cell width of the Jupyter/ipython notebook in my browser? 如何从Jupyter笔记本中将字符串传递给IPython中的boto3函数? - How do I pass a string to a boto3 function in IPython from a Jupyter notebook?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM