jupyter notebook生成py文件

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

try:
    !jupyter nbconvert --to python 文件名
except:
    pass
原文地址:https://www.cnblogs.com/Lee-yl/p/13292021.html