如何在Jupyter上以HTML格式导出当前笔记本 [英] How to export current notebook in HTML on Jupyter

查看:543
本文介绍了如何在Jupyter上以HTML格式导出当前笔记本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将当前笔记本(使用 Python 从笔记本本身内部)导出到HTML(到自定义输出路径)?

How can I export the current notebook (from inside the notebook itself, using Python) to HTML (to a custom output path)?

推荐答案

通过查看 nbconvert文档,您会看到可以使用-来html 方法:

By looking at nbconvert docs, you'll see that you can use --to html method:

import os

os.system('jupyter nbconvert --to html yourNotebook.ipynb')

这将在yourNotebook.ipynb文件夹内创建一个yourNotebook.html文件.

This will create a yourNotebook.html file inside yourNotebook.ipynb folder.

这篇关于如何在Jupyter上以HTML格式导出当前笔记本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆