ubuntu下ipynb文件转py文件

1、先安装jupyter库:pip install jupyter

bash 复制代码
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

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

cpp 复制代码
[NbConvertApp] Converting notebook instance.ipynb to script
[NbConvertApp] Writing 3548 bytes to instance.py

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

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

相关推荐
zhaqonianzhu2 小时前
Linux GPIO 使用 Pinctrl 及 Gpiolib 通俗详解
linux·安卓
天雪浪子3 小时前
Python入门教程之逻辑运算符
开发语言·python
网硕互联的小客服3 小时前
408 Request Timeout:请求超时,服务器等待客户端发送请求的时间过长。
运维·服务器
王伯安呢3 小时前
告别线缆束缚!AirDroid Cast 多端投屏,让分享更自由
运维·服务器·教程·投屏·airdroid cast·多端互投
逍遥浪子~3 小时前
搭建本地gitea服务器
运维·服务器·gitea
骄傲的心别枯萎3 小时前
RV1126 NO.16:通过多线程同时获取H264和H265码流
linux·c++·音视频·rv1126
空灵之海3 小时前
Ubuntu系统安全合规配置
linux·ubuntu·系统安全·1024程序员节
喜欢你,还有大家3 小时前
FTP文件传输服务
linux·运维·服务器·前端
张子夜 iiii3 小时前
实战项目-----在图片 hua.png 中,用红色画出花的外部轮廓,用绿色画出其简化轮廓(ε=周长×0.005),并在同一窗口显示
人工智能·pytorch·python·opencv·计算机视觉