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

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

相关推荐
好开心啊没烦恼14 分钟前
Python 数据分析:DataFrame,生成,用字典创建 DataFrame ,键值对数量不一样怎么办?
开发语言·python·数据挖掘·数据分析
Johny_Zhao16 分钟前
Docker 一键安装部署 JumpServer 堡垒机
linux·网络安全·信息安全·云计算·shell·jumpserver·ldap·yum源·系统运维
AIbase202420 分钟前
国内MCP服务平台推荐!aibase.cn上线MCP服务器集合平台
运维·服务器·人工智能
艾立泰智能包装29 分钟前
电商分拣的“效率密码”:艾立泰轻量化托盘引领自动化流水线革新
运维·自动化
cpsvps_net32 分钟前
Windows内存泄漏自动化
运维·自动化
周树皮不皮1 小时前
20250704【翻转&二叉树】|Leetcodehot100之226【pass】&今天计划
python
魔芋红茶1 小时前
spring-initializer
python·学习·spring
喜欢吃豆1 小时前
快速手搓一个MCP服务指南(九): FastMCP 服务器组合技术:构建模块化AI应用的终极方案
服务器·人工智能·python·深度学习·大模型·github·fastmcp
你不知道我是谁?1 小时前
负载均衡--常见负载均衡算法
运维·负载均衡
一个天蝎座 白勺 程序猿1 小时前
Python(28)Python循环语句指南:从语法糖到CPython字节码的底层探秘
开发语言·python