C_Meng PSNA

Never wait for the storm to pass, just dance in the rain.

0%

如何把jupyter notebook自动转换为python脚本

将YOURNOTEBOOKNAME替换为需要转换的文件名称,运行以下命令即可

1
jupyter nbconvert --to script YOURNOTEBOOKNAME.ipynb

如果使用了anaconda环境,且未将其设置为默认环境的话,可以在jupyter命令前补充安装路径。

以安装路径为“~/opt/anaconda3”为例:

1
~/opt/anaconda3/bin/jupyter nbconvert --to script YOURNOTEBOOKNAME.ipynb
点击这个按钮,会有好事发生哦~(>w<)~