Skip to content

Commit adb591a

Browse files
author
Quarto GHA Workflow Runner
committed
Built site for gh-pages
1 parent a519fe4 commit adb591a

30 files changed

Lines changed: 334 additions & 296 deletions

.nojekyll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
62b0fe6b
1+
22edc382
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<script src="site_libs/quarto-search/fuse.min.js"></script>
6666
<script src="site_libs/quarto-search/quarto-search.js"></script>
6767
<meta name="quarto:offset" content="./">
68-
<link href="./010_executing_code.html" rel="next">
68+
<link href="./01_2_executing_code.html" rel="next">
6969
<link href="./index.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>
@@ -196,7 +196,7 @@
196196
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
197197
<i class="bi bi-layout-text-sidebar-reverse"></i>
198198
</button>
199-
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./01_getting_started.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></a></li></ol></nav>
199+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./01_1_getting_started.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></a></li></ol></nav>
200200
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
201201
</a>
202202
</div>
@@ -220,13 +220,13 @@
220220
</li>
221221
<li class="sidebar-item">
222222
<div class="sidebar-item-container">
223-
<a href="./01_getting_started.html" class="sidebar-item-text sidebar-link active">
223+
<a href="./01_1_getting_started.html" class="sidebar-item-text sidebar-link active">
224224
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></span></a>
225225
</div>
226226
</li>
227227
<li class="sidebar-item">
228228
<div class="sidebar-item-container">
229-
<a href="./010_executing_code.html" class="sidebar-item-text sidebar-link">
229+
<a href="./01_2_executing_code.html" class="sidebar-item-text sidebar-link">
230230
<span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Executing Code</span></span></a>
231231
</div>
232232
</li>
@@ -856,7 +856,7 @@ <h2 data-number="1.3" class="anchored" data-anchor-id="working-on-a-project"><sp
856856
</a>
857857
</div>
858858
<div class="nav-page nav-page-next">
859-
<a href="./010_executing_code.html" class="pagination-link" aria-label="Executing Code">
859+
<a href="./01_2_executing_code.html" class="pagination-link" aria-label="Executing Code">
860860
<span class="nav-page-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Executing Code</span></span> <i class="bi bi-arrow-right-short"></i>
861861
</a>
862862
</div>
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<script src="site_libs/quarto-search/quarto-search.js"></script>
6767
<meta name="quarto:offset" content="./">
6868
<link href="./02_types_data_structures.html" rel="next">
69-
<link href="./01_getting_started.html" rel="prev">
69+
<link href="./01_1_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>
7272
<script src="site_libs/quarto-html/axe/axe-check.js" type="module"></script>
@@ -196,7 +196,7 @@
196196
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
197197
<i class="bi bi-layout-text-sidebar-reverse"></i>
198198
</button>
199-
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./010_executing_code.html"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Executing Code</span></a></li></ol></nav>
199+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./01_2_executing_code.html"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Executing Code</span></a></li></ol></nav>
200200
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
201201
</a>
202202
</div>
@@ -220,13 +220,13 @@
220220
</li>
221221
<li class="sidebar-item">
222222
<div class="sidebar-item-container">
223-
<a href="./01_getting_started.html" class="sidebar-item-text sidebar-link">
223+
<a href="./01_1_getting_started.html" class="sidebar-item-text sidebar-link">
224224
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></span></a>
225225
</div>
226226
</li>
227227
<li class="sidebar-item">
228228
<div class="sidebar-item-container">
229-
<a href="./010_executing_code.html" class="sidebar-item-text sidebar-link active">
229+
<a href="./01_2_executing_code.html" class="sidebar-item-text sidebar-link active">
230230
<span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Executing Code</span></span></a>
231231
</div>
232232
</li>
@@ -405,7 +405,7 @@ <h1 class="title"><span class="chapter-number">2</span>&nbsp; <span class="chapt
405405
</header>
406406

407407

408-
<p>There are several ways to execute code.</p>
408+
<p>There are several ways to execute (also called “run”) Python code.</p>
409409
<section id="executing-files" class="level2" data-number="2.1">
410410
<h2 data-number="2.1" class="anchored" data-anchor-id="executing-files"><span class="header-section-number">2.1</span> Executing files</h2>
411411
<p>When working with <code>uv</code> we can do this (inside of the working project directory):</p>
@@ -435,7 +435,7 @@ <h2 data-number="2.2" class="anchored" data-anchor-id="built-in-repl"><span clas
435435
<blockquote class="blockquote">
436436
<p>A read–eval–print loop (REPL) is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user.</p>
437437
</blockquote>
438-
<p>If type <code>uv run python</code> in our terminal and hit enter, we get into the built-in python REPL.</p>
438+
<p>If we type <code>uv run python</code> in our terminal and hit enter, we get into the built-in python REPL.</p>
439439
<p>The built-in python REPL is fine, but as of today (October 2024) it has some limitations.</p>
440440
<div class="callout callout-style-default callout-note callout-titled">
441441
<div class="callout-header d-flex align-content-center">
@@ -473,7 +473,7 @@ <h2 data-number="2.3" class="anchored" data-anchor-id="ipython-repl"><span class
473473
<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>
474474
<ul>
475475
<li><code>?</code></li>
476-
<li><code>! &lt;COMMAND&gt;</code>: Call the system COMMAND, eg <code>!ls</code> to list contents.</li>
476+
<li><code>! &lt;COMMAND&gt;</code>: Call the system COMMAND, eg <code>!ls</code> to list contents of current directory.</li>
477477
<li><code>%run</code>: Run a file inside IPython as a program.</li>
478478
<li><code>%time</code>: Time execution of a Python statement or expression.</li>
479479
<li><code>%timeit</code>: Time execution of a Python statement or expression.</li>
@@ -487,23 +487,25 @@ <h3 data-number="2.3.1" class="anchored" data-anchor-id="exercises"><span class=
487487
<li>Multiply 3 twenty two times</li>
488488
<li>Print your name using the <code>print</code> function</li>
489489
<li>Add two strings, e.g.&nbsp;“hello” + “world”</li>
490-
<li>Run the file <code>hello.py</code> inside the REPL</li>
490+
<li>Create the file <code>src/pycourse/main.py</code> that prints your name and run it inside the IPython REPL</li>
491491
<li>Same but print it’s execution time</li>
492492
</ol>
493493
</section>
494494
</section>
495495
<section id="code-editor" class="level2" data-number="2.4">
496496
<h2 data-number="2.4" class="anchored" data-anchor-id="code-editor"><span class="header-section-number">2.4</span> Code Editor</h2>
497497
<p>When editing code more extensively we also want to have a so called integrated development environment (IDE). There are many options out there. Do not spend too much time deciding which to pick, you can always change your choice later.<br>
498-
<a href="https://code.visualstudio.com/">VS-Code</a> is a reasonable general choice as of today, it is free and widely adopted. For a user experience more similar to matlab and oriented to scientific computing you can check out <a href="https://www.spyder-ide.org">Spyder</a>.</p>
498+
<a href="https://code.visualstudio.com/">VS-Code</a> is a reasonable general choice as of today, it is free and widely adopted. For a user experience more similar to matlab or R-studio and oriented to scientific computing you can check out <a href="https://www.spyder-ide.org">Spyder</a>.</p>
499499
</section>
500500
<section id="jupyter-notebook" class="level2" data-number="2.5">
501501
<h2 data-number="2.5" class="anchored" data-anchor-id="jupyter-notebook"><span class="header-section-number">2.5</span> Jupyter Notebook</h2>
502-
<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>
502+
<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 <a href="https://www.wolfram.com/mathematica/">Mathematica</a> you’ll be already familiar with them.</p>
503503
<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>
504504
<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>
505505
<p>Let’s create a directory for notebooks in our project:</p>
506506
<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>
507+
<p>So far your project should look like this:</p>
508+
<p><img src="./images/tree.png" class="img-fluid"></p>
507509
<p>Launch a jupyterlab session:</p>
508510
<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>
509511
<div class="callout callout-style-default callout-tip callout-titled">
@@ -926,7 +928,7 @@ <h2 data-number="2.5" class="anchored" data-anchor-id="jupyter-notebook"><span c
926928
</script>
927929
<nav class="page-navigation">
928930
<div class="nav-page nav-page-previous">
929-
<a href="./01_getting_started.html" class="pagination-link" aria-label="Getting Started">
931+
<a href="./01_1_getting_started.html" class="pagination-link" aria-label="Getting Started">
930932
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></span>
931933
</a>
932934
</div>

0 commit comments

Comments
 (0)