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

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

相关推荐
dualven_in_csdn37 分钟前
搞了两天的win7批处理脚本问题
java·linux·前端
晨曦backend2 小时前
Vim 匹配跳转与搜索命令完整学习笔记
linux·编辑器·vim
亚林瓜子3 小时前
AWS中国云的定时任务(AWS EventBridge+AWS Lambda)
python·云计算·aws·lambda·定时任务·event·cron
bing_feilong3 小时前
Windows上SSH连接Ubuntu失败
windows·ubuntu·ssh
摆渡搜不到你3 小时前
某腾X视频下载器2.1
python·音视频
爬呀爬的水滴4 小时前
解决Ubuntu24.04版本,右键没有共享选项的问题
linux·服务器·ubuntu·samba·共享文件夹
科雷软件测试4 小时前
Python格式化:让数据输出更优雅
python
IT coke4 小时前
centos7部署AWStats日志分析系统
linux·运维·centos
非小号4 小时前
多模态分类案例实现
python·分类·数据挖掘
Mi Manchi264 小时前
力扣热题100之二叉树的层序遍历
python·算法·leetcode