|
5 | 5 | <link href="https://learnbyexample.github.io/atom.xml" rel="self" type="application/atom+xml"/>
|
6 | 6 | <link href="https://learnbyexample.github.io"/>
|
7 | 7 | <generator uri="https://www.getzola.org/">Zola</generator>
|
8 |
| - <updated>2024-11-12T00:00:00+00:00</updated> |
| 8 | + <updated>2024-11-14T00:00:00+00:00</updated> |
9 | 9 | <id>https://learnbyexample.github.io/atom.xml</id>
|
10 | 10 | <entry xml:lang="en">
|
11 | 11 | <title>Festive offers for books on Python, Linux, Regular Expressions, Vim and more!</title>
|
|
41 | 41 | <entry xml:lang="en">
|
42 | 42 | <title>Interactive Python Exercises and Quiz</title>
|
43 | 43 | <published>2024-10-29T00:00:00+00:00</published>
|
44 |
| - <updated>2024-10-29T00:00:00+00:00</updated> |
| 44 | + <updated>2024-11-14T00:00:00+00:00</updated> |
45 | 45 | <link rel="alternate" href="https://learnbyexample.github.io/interactive-python-exercises/" type="text/html"/>
|
46 | 46 | <id>https://learnbyexample.github.io/interactive-python-exercises/</id>
|
47 | 47 | <content type="html"><p>Having an interactive program that automatically loads questions and checks the solution is wonderful to have while learning a topic. This <a href="https://github.com/learnbyexample/TUI-apps/tree/main/PythonExercises">TUI app</a> has beginner to intermediate level exercises and multiple-choice questions for Python learners.</p>
|
48 | 48 | <p align="center"><img src="https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_exercises.png" alt="Sample screenshot for Python exercises" loading="lazy" /></p>
|
49 |
| -<blockquote> |
50 |
| -<p><img src="/images/warning.svg" alt="warning" /> <img src="/images/warning.svg" alt="warning" /> This is a work-in-progress project.</p> |
51 |
| -</blockquote> |
52 | 49 | <span id="continue-reading"></span><br>
|
53 | 50 | <h2 id="installation">Installation<a class="zola-anchor" href="#installation" aria-label="Anchor link for: installation">🔗</a></h2>
|
54 |
| -<p>Install <code>textual</code> (see <a href="https://textual.textualize.io/getting_started/">Textual documentation</a> for more details), clone this repository and run the <code>python_exercises.py</code> file. You'll need to install <code>textual[syntax]</code> to enable syntax highlighting (see <a href="https://textual.textualize.io/widgets/text_area/#syntax-highlighting-dependencies">documentation</a> for more details).</p> |
55 |
| -<p><strong>TODO</strong>: PyPI app</p> |
| 51 | +<p>This app is available on PyPI as <a href="https://pypi.org/project/pythonexercises/">pythonexercises</a>. Example installation instructions are shown below, adjust them based on your preferences and OS.</p> |
| 52 | +<pre data-lang="bash" style="background-color:#f5f5f5;color:#1f1f1f;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#7f8989;"># virtual environment |
| 53 | +</span><span style="color:#5597d6;">$</span><span> python3</span><span style="color:#5597d6;"> -m</span><span> venv textual_apps |
| 54 | +</span><span style="color:#5597d6;">$</span><span> cd textual_apps |
| 55 | +</span><span style="color:#5597d6;">$</span><span> source bin/activate |
| 56 | +</span><span style="color:#5597d6;">$</span><span> pip install pythonexercises |
| 57 | +</span><span> |
| 58 | +</span><span style="color:#7f8989;"># launch the app |
| 59 | +</span><span style="color:#5597d6;">$</span><span> pythonexercises |
| 60 | +</span></code></pre> |
| 61 | +<blockquote> |
| 62 | +<p><img src="/images/info.svg" alt="info" /> If you are on Windows, using the <a href="https://en.wikipedia.org/wiki/Windows_Terminal">Windows Terminal</a> is recommended. See <a href="https://github.com/learnbyexample/TUI-apps/issues/3#issuecomment-1481488042">this issue</a> for Virtual Environment commands and other details.</p> |
| 63 | +</blockquote> |
| 64 | +<p>To run the app without having to enter the virtual environment again, add this alias to <code>.bashrc</code> (or equivalent):</p> |
| 65 | +<pre data-lang="bash" style="background-color:#f5f5f5;color:#1f1f1f;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#7f8989;"># you&#39;ll have to change the path |
| 66 | +</span><span style="color:#b39f04;">alias </span><span style="color:#c23f31;">pythonexercises</span><span style="color:#72ab00;">=</span><span style="color:#d07711;">&#39;/path/to/textual_apps/bin/pythonexercises&#39; |
| 67 | +</span></code></pre> |
| 68 | +<p>As an alternative to manually managing such virtual environments, you can use <a href="https://github.com/pypa/pipx">https://github.com/pypa/pipx</a> instead:</p> |
| 69 | +<pre data-lang="bash" style="background-color:#f5f5f5;color:#1f1f1f;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#5597d6;">$</span><span> pipx install pythonexercises |
| 70 | +</span><span style="color:#5597d6;">$</span><span> pythonexercises |
| 71 | +</span></code></pre> |
| 72 | +<p>As yet another alternative, you can install <code>textual</code> (see <a href="https://textual.textualize.io/getting_started/">Textual documentation</a> for more details), clone this repository and run the <code>python_exercises.py</code> file. You'll need to install <code>textual[syntax]</code> to enable syntax highlighting (see <a href="https://textual.textualize.io/widgets/text_area/#syntax-highlighting-dependencies">documentation</a> for more details).</p> |
56 | 73 | <p>Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines). Here's another screenshot:</p>
|
57 |
| -<p align="center"><img src="https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_quiz.png" alt="Sample screenshot for Python exercises" loading="lazy" /></p> |
| 74 | +<p align="center"><img src="https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_quiz.png" alt="Sample screenshot for Python quiz" loading="lazy" /></p> |
| 75 | +<br> |
58 | 76 | <h2 id="guide">Guide<a class="zola-anchor" href="#guide" aria-label="Anchor link for: guide">🔗</a></h2>
|
59 | 77 | <p>See <a href="https://github.com/learnbyexample/TUI-apps/blob/main/PythonExercises/app_guide.md">app_guide.md</a> for instructions.</p>
|
60 | 78 | <br>
|
|
0 commit comments