JupyterHub: Difference between revisions

Marked this version for translation
(Added section on how to run notebook as python scripts)
(Marked this version for translation)
Line 258: Line 258:
* The desktop session will end when the JupyterLab session ends.
* The desktop session will end when the JupyterLab session ends.


== Running notebooks as Python scripts ==
== Running notebooks as Python scripts == <!--T:65-->


<!--T:66-->
1. From the console, or in a new notebook cell, install <tt>nbconvert</tt> :
1. From the console, or in a new notebook cell, install <tt>nbconvert</tt> :
<syntaxhighlight lang="bash">!pip install --no-index nbconvert</syntaxhighlight>
<syntaxhighlight lang="bash">!pip install --no-index nbconvert</syntaxhighlight>


<!--T:67-->
2. Convert your notebooks to Python scripts
2. Convert your notebooks to Python scripts
<syntaxhighlight lang="bash">!jupyter nbconvert --to python my-current-notebook.ipynb</syntaxhighlight>
<syntaxhighlight lang="bash">!jupyter nbconvert --to python my-current-notebook.ipynb</syntaxhighlight>


<!--T:68-->
3. Create your [[Running_jobs#Use_sbatch_to_submit_jobs|non-interactive submission script]], and submit it.
3. Create your [[Running_jobs#Use_sbatch_to_submit_jobs|non-interactive submission script]], and submit it.


<!--T:69-->
In your submission script, run your converted notebook with:
In your submission script, run your converted notebook with:
<syntaxhighlight lang="bash">python my-current-notebook.py</syntaxhighlight>
<syntaxhighlight lang="bash">python my-current-notebook.py</syntaxhighlight>


<!--T:70-->
And submit your non-interactive job:
And submit your non-interactive job:
{{Command
{{Command
cc_staff
284

edits