• ubuntu下ipynb文件转py文件


    1、先安装jupyter库:pip install jupyter

    Collecting fqdn
      Downloading fqdn-1.5.1-py3-none-any.whl (9.1 kB)
    Collecting isoduration
      Downloading isoduration-20.11.0-py3-none-any.whl (11 kB)
    Collecting uri-template
      Downloading uri_template-1.2.0-py3-none-any.whl (10 kB)
    Collecting arrow>=0.15.0
      Downloading arrow-1.2.3-py3-none-any.whl (66 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.4/66.4 kB 7.5 MB/s eta 0:00:00
    Installing collected packages: webencodings, wcwidth, pure-eval, ptyprocess, pickleshare, mistune, ipython-genutils, 
    fastjsonschema, executing, backcall, widgetsnbextension, websocket-client, webcolors, uri-template, traitlets, tornado, 
    tinycss2, soupsieve, sniffio, Send2Trash, rfc3986-validator, rfc3339-validator, pyzmq, python-json-logger, pyrsistent, 
    pycparser, psutil, prompt-toolkit, prometheus-client, pkgutil-resolve-name, pexpect, parso, pandocfilters, nest-asyncio, 
    jupyterlab-widgets, jupyterlab-pygments, jsonpointer, jinja2, install, importlib-resources, fqdn, defusedxml, decorator, 
    debugpy, bleach, attrs, asttokens, terminado, stack-data, qtpy, matplotlib-inline, jupyter-core, jsonschema, jedi, comm, cffi,
    beautifulsoup4, arrow, anyio, nbformat, jupyter-server-terminals, jupyter-client, isoduration, ipython, argon2-cffi-bindings,
    nbclient, ipykernel, argon2-cffi, qtconsole, nbconvert, jupyter-events, jupyter-console, ipywidgets, jupyter-server, 
    notebook-shim, nbclassic, notebook, jupyter
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    2、转换文件:jupyter nbconvert --to script 文件名.ipynb

    [NbConvertApp] Converting notebook instance.ipynb to script
    [NbConvertApp] Writing 3548 bytes to instance.py
    
    • 1
    • 2

    可以看到同级目录下生成了它的py文件。

    说话前做事前都要多动脑子思考,不要做没有意义的重复工作

  • 相关阅读:
    Django5实战
    【Multiwfn学习】-Multiwfn批量读入xyz结构文件并生成ORCA输入文件
    YOLO V5、SAM、RESNET50模型在GPU环境下搭建过程
    C#__线程的优先级和状态控制
    算法通关村第二关-青铜终于学会链表了
    Vue3.0-如此简单的setup
    VMware虚拟机安装Centos7系统(网络模式、桌面选择、手动分区、Kdump)
    java-对数据结构的简单认识
    400Gbps 网络面临的挑战
    gateway 集成 nacos 实现动态路由
  • 原文地址:https://blog.csdn.net/qq_42257666/article/details/130810291