美文网首页
将.ipynb文件转换为python/shell脚本

将.ipynb文件转换为python/shell脚本

作者: 小孟在充电 | 来源:发表于2024-03-14 16:00 被阅读0次

利用nbconvert包进行格式转换

# installing tools 
conda install anaconda::nbconvert

basic usage

jupyter nbconvert --to FORMAT notebook.ipynb
# e.g.
# convert .ipynb to .py files
jupyter nbconvert --to python notebook.ipynb

# convert .ipynb to .sh files
jupyter nbconvert --to script notebook.ipynb

其他用法

参考:https://nbconvert.readthedocs.io/en/latest/usage.html#converting-multiple-notebooks

相关文章

网友评论

      本文标题:将.ipynb文件转换为python/shell脚本

      本文链接:https://www.haomeiwen.com/subject/ijswzdtx.html