22< html xmlns ="http://www.w3.org/1999/xhtml " lang ="en " xml:lang ="en "> < head >
33
44< meta charset ="utf-8 ">
5- < meta name ="generator " content ="quarto-1.7.30 ">
5+ < meta name ="generator " content ="quarto-1.8.25 ">
66
77< meta name ="viewport " content ="width=device-width, initial-scale=1.0, user-scalable=yes ">
88
6969< link href ="./01_getting_started.html " rel ="prev ">
7070< script src ="site_libs/quarto-html/quarto.js " type ="module "> </ script >
7171< script src ="site_libs/quarto-html/tabsets/tabsets.js " type ="module "> </ script >
72+ < script src ="site_libs/quarto-html/axe/axe-check.js " type ="module "> </ script >
7273< script src ="site_libs/quarto-html/popper.min.js "> </ script >
7374< script src ="site_libs/quarto-html/tippy.umd.min.js "> </ script >
7475< script src ="site_libs/quarto-html/anchor.min.js "> </ script >
7576< link href ="site_libs/quarto-html/tippy.css " rel ="stylesheet ">
76- < link href ="site_libs/quarto-html/quarto-syntax-highlighting-82d7c92e6dd9441483e496b14b812ba9 .css " rel ="stylesheet " id ="quarto-text-highlighting-styles ">
77+ < link href ="site_libs/quarto-html/quarto-syntax-highlighting-8d579c7e4cb5e38eaddfdf7e7f03f655 .css " rel ="stylesheet " id ="quarto-text-highlighting-styles ">
7778< script src ="site_libs/bootstrap/bootstrap.min.js "> </ script >
7879< link href ="site_libs/bootstrap/bootstrap-icons.css " rel ="stylesheet ">
79- < link href ="site_libs/bootstrap/bootstrap-378a9e929b76e306574896faf77f55a6 .min.css " rel ="stylesheet " append-hash ="true " id ="quarto-bootstrap " data-mode ="light ">
80+ < link href ="site_libs/bootstrap/bootstrap-560e00388d6c3931de6d761239f1d17b .min.css " rel ="stylesheet " append-hash ="true " id ="quarto-bootstrap " data-mode ="light ">
8081< script id ="quarto-search-options " type ="application/json "> {
8182 "location" : "navbar" ,
8283 "copy-button" : false ,
117118 < nav class ="navbar navbar-expand-lg " data-bs-theme ="dark ">
118119 < div class ="navbar-container container-fluid ">
119120 < div class ="navbar-brand-container mx-auto ">
121+ < a href ="./index.html " class ="navbar-brand navbar-brand-logo ">
122+ </ a >
120123 < a class ="navbar-brand " href ="./index.html ">
121124 < span class ="navbar-title "> Python Course</ span >
122125 </ a >
203206< div id ="quarto-content " class ="quarto-container page-columns page-rows-contents page-layout-article page-navbar ">
204207<!-- sidebar -->
205208 < nav id ="quarto-sidebar " class ="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto ">
209+ < div class ="pt-lg-2 mt-2 text-left sidebar-header sidebar-header-stacked ">
210+ < a href ="./index.html " class ="sidebar-logo-link ">
211+ </ a >
212+ </ div >
206213 < div class ="sidebar-menu-container ">
207214 < ul class ="list-unstyled mt-1 ">
208215 < li class ="sidebar-item ">
@@ -402,12 +409,12 @@ <h1 class="title"><span class="chapter-number">2</span> <span class="chapt
402409< section id ="executing-files " class ="level2 " data-number ="2.1 ">
403410< h2 data-number ="2.1 " class ="anchored " data-anchor-id ="executing-files "> < span class ="header-section-number "> 2.1</ span > Executing files</ h2 >
404411< p > When working with < code > uv</ code > we can do this (inside of the working project directory):</ p >
405- < div class ="sourceCode " id ="cb1 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb1-1 "> < a href ="#cb1-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run your-file.py</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
412+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb1 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb1-1 "> < a href ="#cb1-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run your-file.py</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
406413< p > Or this:</ p >
407- < div class ="sourceCode " id ="cb2 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb2-1 "> < a href ="#cb2-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run python your-file.py</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
414+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb2 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb2-1 "> < a href ="#cb2-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run python your-file.py</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
408415< p > Alternatively, we could manually activate the virtual environment and run the script:</ p >
409- < div class ="sourceCode " id ="cb3 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb3-1 "> < a href ="#cb3-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="bu "> source</ span > .venv/bin/activate</ span >
410- < span id ="cb3-2 "> < a href ="#cb3-2 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> python</ span > your-file.py</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
416+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb3 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb3-1 "> < a href ="#cb3-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="bu "> source</ span > .venv/bin/activate</ span >
417+ < span id ="cb3-2 "> < a href ="#cb3-2 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> python</ span > your-file.py</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
411418< div class ="callout callout-style-default callout-tip callout-titled ">
412419< div class ="callout-header d-flex align-content-center ">
413420< div class ="callout-icon-container ">
@@ -447,7 +454,7 @@ <h2 data-number="2.2" class="anchored" data-anchor-id="built-in-repl"><span clas
447454< section id ="ipython-repl " class ="level2 " data-number ="2.3 ">
448455< h2 data-number ="2.3 " class ="anchored " data-anchor-id ="ipython-repl "> < span class ="header-section-number "> 2.3</ span > IPython REPL</ h2 >
449456< p > An alternative to that is the IPython REPL. < a href ="https://ipython.org/ "> IPython</ a > is a whole different open source project that builds on top of python itself, but it is independent, thus we need to install IPython.</ p >
450- < div class ="sourceCode " id ="cb4 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb4-1 "> < a href ="#cb4-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > add ipython</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
457+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb4 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb4-1 "> < a href ="#cb4-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > add ipython</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
451458< div class ="callout callout-style-default callout-tip callout-titled ">
452459< div class ="callout-header d-flex align-content-center ">
453460< div class ="callout-icon-container ">
@@ -462,7 +469,7 @@ <h2 data-number="2.3" class="anchored" data-anchor-id="ipython-repl"><span class
462469</ div >
463470</ div >
464471< p > We can fire up the IPython REPL:</ p >
465- < div class ="sourceCode " id ="cb5 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb5-1 "> < a href ="#cb5-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run ipython</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
472+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb5 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb5-1 "> < a href ="#cb5-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run ipython</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
466473< p > The IPython REPL brings some nice features that make this interactive coding environment much powerful and handy to interact with, such as < a href ="https://ipython.readthedocs.io/en/stable/interactive/magics.html#built-in-magic-commands "> magic commands</ a > . These are some commands I recommend checking out:</ p >
467474< ul >
468475< li > < code > ?</ code > </ li >
@@ -494,11 +501,11 @@ <h2 data-number="2.4" class="anchored" data-anchor-id="code-editor"><span class=
494501< h2 data-number ="2.5 " class ="anchored " data-anchor-id ="jupyter-notebook "> < span class ="header-section-number "> 2.5</ span > Jupyter Notebook</ h2 >
495502< p > Notebooks run on the browser and are a way to mix code with other kinds of data, such as images, videos or widgets. They are a very useful tool for explorative analysis. If you ever used something like Mathematica you’ll be already familiar with them.</ p >
496503< p > There are several versions of notebooks, we are going to use < a href ="https://jupyterlab.readthedocs.io/en/latest/ "> JupyterLab</ a > . Let’s install it:</ p >
497- < div class ="sourceCode " id ="cb6 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb6-1 "> < a href ="#cb6-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > add jupyterlab</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
504+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb6 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb6-1 "> < a href ="#cb6-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > add jupyterlab</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
498505< p > Let’s create a directory for notebooks in our project:</ p >
499- < div class ="sourceCode " id ="cb7 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb7-1 "> < a href ="#cb7-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="fu "> mkdir</ span > noteboooks</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
506+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb7 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb7-1 "> < a href ="#cb7-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="fu "> mkdir</ span > noteboooks</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
500507< p > Launch a jupyterlab session:</ p >
501- < div class ="sourceCode " id ="cb8 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb8-1 "> < a href ="#cb8-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run jupyter lab</ span > </ code > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ pre > </ div >
508+ < div class ="code-copy-outer-scaffold " > < div class =" sourceCode " id ="cb8 "> < pre class ="sourceCode bash code-with-copy "> < code class ="sourceCode bash "> < span id ="cb8-1 "> < a href ="#cb8-1 " aria-hidden ="true " tabindex ="-1 "> </ a > < span class ="ex "> uv</ span > run jupyter lab</ span > </ code > </ pre > </ div > < button title ="Copy to Clipboard " class ="code-copy-button "> < i class ="bi "> </ i > </ button > </ div >
502509< div class ="callout callout-style-default callout-tip callout-titled ">
503510< div class ="callout-header d-flex align-content-center ">
504511< div class ="callout-icon-container ">
@@ -568,13 +575,14 @@ <h2 data-number="2.5" class="anchored" data-anchor-id="jupyter-notebook"><span c
568575 e . clearSelection ( ) ;
569576 }
570577 const getTextToCopy = function ( trigger ) {
571- const codeEl = trigger . previousElementSibling . cloneNode ( true ) ;
572- for ( const childEl of codeEl . children ) {
573- if ( isCodeAnnotation ( childEl ) ) {
574- childEl . remove ( ) ;
575- }
578+ const outerScaffold = trigger . parentElement . cloneNode ( true ) ;
579+ const codeEl = outerScaffold . querySelector ( 'code' ) ;
580+ for ( const childEl of codeEl . children ) {
581+ if ( isCodeAnnotation ( childEl ) ) {
582+ childEl . remove ( ) ;
576583 }
577- return codeEl . innerText ;
584+ }
585+ return codeEl . innerText ;
578586 }
579587 const clipboard = new window . ClipboardJS ( '.code-copy-button:not([data-in-quarto-modal])' , {
580588 text : getTextToCopy
0 commit comments