You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/scripts.rst
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,25 +38,33 @@ In this episode, we will learn how to automate your work using Python scripts so
38
38
From Jupyter notebooks to Python scripts
39
39
-----------------------------------------
40
40
41
+
.. highlight:: console
42
+
43
+
41
44
Save as Python script
42
45
---------------------
43
46
44
47
Jupyter notebooks can be parameterized for instance using `papermill <https://papermill.readthedocs.io/en/latest/>`_. It can be an attractive approach when you have short notebooks (to generate automatically plots/reports) but as soon as you have more complex tasks to execute, we strongly recommend to generate Python scripts. This will also force you to modularize your code. See `CodeRefinery's lesson on Modular code development <https://coderefinery.github.io/modular-type-along/>`__.
45
48
46
-
Within JupyterLab, you can export any Jupyter notebook to a Python script:
49
+
You need to convert the notebook to a Python file.
50
+
Check the `JupyterLab documentation <https://jupyterlab.readthedocs.io/en/stable/user/export.html>`_ for more information.
51
+
You can get a command line by (File → New Launcher → Terminal - if you
52
+
go through New Launcher, your command line will be in the directory
53
+
you are currently browsing), you can convert files in the terminal by running::
0 commit comments