澄清执行Jupyter Notebook

时间:2018-10-22 09:20:24

标签: jupyter-notebook nbconvert

嗨,我一直在尝试通过nbconvert api执行Jupyter笔记本,我希望澄清此代码段中的run_path是什么?由于我的python脚本没有从笔记本收到任何错误

from nbconvert.preprocessors import CellExecutionError

try:
    out = ep.preprocess(nb, {'metadata': {'path': run_path}})

except CellExecutionError:
    out = None
    msg = 'Error executing the notebook "%s".\n\n' % notebook_filename
    msg += 'See notebook "%s" for the traceback.' % notebook_filename_out
    print(msg)
    raise
finally:
    with open(notebook_filename_out, mode='wt') as f:
        nbformat.write(nb, f)

0 个答案:

没有答案