Jupyter notebook ใฏๅฟซ้ฉใ ใใใฉใใๆใฎใใผใใใใฏใ่ฆใใใใซใตใผใใผใใใใใ่ตทๅใใใใฎใๆฐๅ็ใซ้ขๅใจใใใใจใใใใๅๅใจๆ ๅ ฑใๅ ฑๆใใใฎใซ HTML ใฎใปใใ่ฏใใจใใใใจใใใใใใใใชใใใใใใๆใฎใใใซใ่ชๅ็ใซ HTML ใใกใคใซใจ py ใใกใคใซใไฟๅญใใใใใซใใฆใใใจไพฟๅฉใ
ใพใใ๏ผใชใใใฐ๏ผ่จญๅฎใใกใคใซใไฝใใ
% jupyter notebook --generate-config
ไฝใใใ ~/.jupyter/jupyter_notebook_config.py ใ้ใใฆ
# -----------------------------
# Configurable configuration
# -----------------------------
ใฎไธใซใงใ
import os
from subprocess import check_call
def post_save(model, os_path, contents_manager):
"""post-save hook for converting notebooks to .py scripts"""
if model['type'] != 'notebook':
return # only do this for notebooks
d, fname = os.path.split(os_path)
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)
c.FileContentsManager.post_save_hook = post_save
ใใใงใipynb ใไฝใใใใจๅๆใซๅๅใฎ html ใจ py (ใใใใฏ r ใชใฉ๏ผใไฝใใใใ
ๅ่
Jupyter Notebook for Data Science Teams (O'Reilly)
ipython nbconvert ใฏๅคใใจใใ่ญฆๅใใงใใฎใงใๅ่ๅ
ใฎใณใผใใฎ ipython ใ jupyter ใซๅคๆดใใพใใใ