jupyter notebook生成py文件

在一个jupyter notebook中代码最后写入:并将jupyter notebook的文件名称也改为设定的文件名,最后执行以下代码即可生成。

try:
    !jupyter nbconvert --to python 文件名
except:
    pass

 转载

jupyter notebook生成py文件 - 吱吱了了 - 博客园

你可能感兴趣的:(Python,jupyter,python)