How to download a .py file from Jupyter lab notebook?

Tarun Kumar Yellapu picture Tarun Kumar Yellapu · Feb 12, 2019 · Viewed 11k times · Source

In jupyter notebook, there is a provision to download a notebook as .py file. In jupyter lab, there is an option called export as which does not contain an option to download a .py file. Is there any workaround for this, instead of copying the script in the notebook and pasting it in a python file.

Answer

VijayKillu picture VijayKillu · Feb 12, 2019

In Jupyter lab, go to File Menu. Select "Export Notebook as" and then choose the "Export Notebook to Executable Script" option.

For Jupyter notebook, there is "Download as" option in File menu of Jupyter notebook. You can select Python (.py) from the list of available options.