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