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

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

相关推荐
Yan-英杰3 分钟前
百度搜索和文心智能体接入DeepSeek满血版——AI搜索的新纪元
图像处理·人工智能·python·深度学习·deepseek
程序员yt3 分钟前
双非一本电子信息专业自学嵌入式,学完 Linux 后咋走?单片机 & FreeRTOS 要补吗?
linux·运维·单片机
weixin_307779131 小时前
Azure上基于OpenAI GPT-4模型验证行政区域数据的设计方案
数据仓库·python·云计算·aws
玩电脑的辣条哥2 小时前
Python如何播放本地音乐并在web页面播放
开发语言·前端·python
垚垚 Securify 前沿站2 小时前
深入了解 AppScan 工具的使用:筑牢 Web 应用安全防线
运维·前端·网络·安全·web安全·系统安全
多想和从前一样5 小时前
Django 创建表时 “__str__ ”方法的使用
后端·python·django
安於宿命5 小时前
【Linux】进程间通信——进程池
linux·c++
新兴ICT项目支撑5 小时前
天翼云910B部署DeepSeek蒸馏70B LLaMA模型实践总结
linux·运维·服务器·910b·天翼云·deepseek r1
gold20086 小时前
php5 php8 nginx Access denied.
运维·nginx·php8·php-fpm
Yuanymoon6 小时前
Docker 修改配置后无法启动问题
运维·docker·容器