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文件。

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

相关推荐
艾莉丝努力练剑29 分钟前
【Linux基础开发工具 (三)】Vim从入门到精通(下):效率翻倍的编辑技巧与个性化配置攻略
linux·运维·服务器·c++·ubuntu·centos·vim
cheniie37 分钟前
python xmlrpc踩坑记录
python·踩坑·xmlrpc
鹿鸣天涯1 小时前
国产服务器操作系统迁移指南
运维·服务器
Crazy________2 小时前
40nginx从单节点 HTTPS 到集群负载均衡
linux·运维·服务器
ttthe_MOon2 小时前
LVS-NAT 模式负载均衡集群部署与配置指南
运维·负载均衡·lvs
咖啡の猫2 小时前
搭建Python开发环境
开发语言·python
听风吟丶5 小时前
Java 8 Stream API 高级实战:从数据处理到性能优化的深度解析
开发语言·python
悟空码字5 小时前
部署Spring Boot项目到Linux服务器数据盘
linux·spring boot·部署·数据盘
文人sec6 小时前
pytest1-接口自动化测试场景
软件测试·python·单元测试·pytest
Once_day7 小时前
Linux之rsyslog(6)RainerScript
linux·服务器·syslog