现已上市.py

IPYNB Python

将代码单元导出到单个.py 文件。Markdown 变成注释;你得到一份可运行的脚本,方便评审或接入 CI。

Free and instant. Files are processed briefly on our servers for conversion, then discarded — nothing is stored.

它是如何运作的

从上传到下载三步

1

放下你的笔记本

.ipynb 拖到卡上或浏览您的文件。您永远不会创建帐户。

2

选择导出

选择 Word、PDF、Markdown、HTML、LaTeX、ZIP、Python 工具、查看器、清理器、合并器或拆分器 - 任何与您的审阅者匹配的工具。

3

下载并发货

立即获取完成的文件。在本地打开它,将其附加到电子邮件中,或上传到您的 LMS。

IPYNB to Python: turn a Jupyter notebook into a plain.py script in your browser

A Jupyter notebook (.ipynb) is JSON under the hood: cells, metadata, and outputs bundled together. When you need a single Python file instead, something you can drop into a repo, run with python script.py, or hand to someone who does not use notebooks, this ipynb to python converter online does the job right here. Upload the notebook, flip a few switches for markdown and outputs, and download a .py file. Nothing is uploaded to a server; the file stays on your machine.

People find this page with many phrasings: ipynb to python script, ipynb to py, convert ipynb to python file, or save ipynb as python without digging through menus in JupyterLab or VS Code. Maybe you are on a borrowed laptop, maybe your local jupyter nbconvert install is broken, or maybe you just want the fastest path from notebook to script. Same idea: bring the .ipynb, leave with runnable ipynb to python code.

The export follows a familiar pattern: code cells become real Python, markdown cells turn into # comment lines so you still see the narrative, and you can optionally paste cell outputs under # Output: comments when that helps debugging or grading. Cell boundaries use # %% markers so editors like VS Code still understand sections, handy if you later round-trip with a py to ipynb converter online free workflow on our Python to Notebook tool.

If you were searching for convert ipynb into pdf, convert ipynb to txt, or download ipynb examples: PDF lives on our IPYNB to PDF page; plain text is often just saving the .py or copying raw JSON from our JSON tool; and you never need an account here, just the browser tab.

IPYNB to Python: turn a Jupyter notebook into a plain.py script in your browser

Why use this ipynb to python converter

One.py from the whole notebook

Code cells are stitched into a single script with clear separators. You get something you can run, lint, or ship, without carrying the notebook JSON around.

Markdown stays in the file

Toggle “include markdown as comments” so headings and prose sit above the code as # lines. Readers still see the story the notebook told.

VS Code–friendly cell markers

Optional # %% lines mark cell boundaries, similar to Jupytext percent format, so tools that split on markers keep working after you leave Jupyter.

Outputs when you need them

Turn on “include outputs as comments” to freeze prints and streams under each cell. Leave it off for a slim script meant for production.

Private in the browser

Secure server conversion processes the file briefly and does not store it afterward.

No Python install required here

You still need Python somewhere if you want to execute the exported file, but you do not need nbconvert or Jupyter installed on this computer just to produce the .py.

FAQ

Frequently asked questions

Open this page, upload your .ipynb, set the options you want, and download a .py file. There is no charge, no signup, and the conversion runs in your browser, your notebook is not stored on our servers.

Both mean the same here: you receive one .py file containing all code cells in order, with markdown optionally commented out. Save it wherever you keep scripts and run it with python yourfile.py when you are ready.

In JupyterLab or classic Jupyter you can sometimes use File → Save and Export or rely on nbconvert. If that menu is missing or fails, use this converter: upload the exported .ipynb and download the .py immediately.

Locally you might run jupyter nbconvert --to script notebook.ipynb if your environment is set up. When you cannot, or you want the commented markdown and # %% layout this tool produces, upload the notebook here and save the downloaded file as something.py.

Code cells are already Python source inside the notebook JSON; this tool extracts them into plain text. For a quick peek without exporting, you could open the .ipynb in a text editor, but you would still see JSON noise, exporting to .py is the readable route.

To execute a notebook programmatically, people often use nbconvert with ExecutePreprocessor, or open it in Jupyter and press Run All. After you convert to .py here, you can run the script with the same interpreter you would use for any Python file.

A raw .ipynb is not a normal import target, you typically load it with nbformat or run it through Jupyter. If you need import mynotebook style reuse, convert interesting cells into a real .py module first, or use a dedicated loader package. This exporter gives you a starting .py you can refactor into modules.

Use our Python to Jupyter Notebook converter: upload .py and download .ipynb. It pairs with this page when you edit the exported script and want notebook format again, convert py to ipynb online free on that route.

It is a Jupyter Notebook stored as JSON: metadata plus an ordered list of cells (markdown, code, raw). The .ipynb extension tells editors and Jupyter to treat it as a notebook, not a flat script.

.py is a plain Python source file, usually one narrative from top to bottom. .ipynb keeps cells, optional outputs, and kernel metadata so you can mix prose and code interactively. Many projects commit both: notebooks for exploration, .py for libraries and entry points.

The notebook often holds Python code cells, but the file itself is JSON, not something you run with python notebook.ipynb unless a tool interprets it first. After export, the .py is ordinary Python text.

The format is language-agnostic, kernels exist for R, Julia, and others, but Python is the most common case on this site. This exporter targets Python notebooks.

Jupyter is an interface; it needs a kernel. Many Anaconda or scientific stacks install Python and Jupyter together, but they are separate pieces, you can have Jupyter talking to different Python versions or other languages.

Wherever you saved them: Documents, a git repo, Downloads, or cloud sync folders. Jupyter does not hide notebooks in a special database, they are normal files on disk with an .ipynb ending.

Yes for producing the file in the browser here. Running or testing that script later still requires Python on your machine if you want execution, not just editing.

PDF is for reading and printing a fixed layout. This page produces editable source code. If you need a report page, use our IPYNB to PDF converter instead.

Your download here is a .py text file. If you literally need .txt, rename after download or copy into Notepad. For raw JSON text of the notebook, try our IPYNB to JSON tool.

Usually people mean opening or converting a notebook in the browser. You bring a notebook you already downloaded from GitHub, Colab, or email; we help you turn it into Python, or you can view it with our viewer. We do not host a library of example notebooks.

Open any .ipynb in a text editor: you will see keys like cells, metadata, and nbformat. Each cell has cell_type and source. That structure is why a dedicated ipynb to python converter helps instead of manual copy-paste.