-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathindex.html
13 lines (13 loc) Β· 9.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Interactive Python Exercises and Quiz</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content="Interactive Python Exercises and Quiz" property=og:title><meta content=website property=og:type><meta content="Interactive TUI app with exercises and multiple-choice questions for beginner to intermediate level Python learners" property=og:description><meta content=https://learnbyexample.github.io/interactive-python-exercises/ property=og:url><meta content=https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_exercises.png property=og:image><meta content=1200 property=og:image:width><meta content=786 property=og:image:height><meta content=summary_large_image property=twitter:card><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><div class=post-toc id=post-toc><h2 class=post-toc-title>Contents</h2><div class="post-toc-content always-active"><nav id=TableOfContents><ul><li><a class=toc-link href=https://learnbyexample.github.io/interactive-python-exercises/#installation>Installation</a><li><a class=toc-link href=https://learnbyexample.github.io/interactive-python-exercises/#guide>Guide</a><li><a class=toc-link href=https://learnbyexample.github.io/interactive-python-exercises/#ebook>Ebook</a><li><a class=toc-link href=https://learnbyexample.github.io/interactive-python-exercises/#feedback>Feedback</a></ul></nav></div></div><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/interactive-python-exercises/>Interactive Python Exercises and Quiz</a></h1><div class=post__meta><span class=post__time>2024-10-29</span></div></header><div class=post-content><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 align=center><img alt="Sample screenshot for Python exercises" loading=lazy src=https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_exercises.png></p><span id=continue-reading></span><br><h2 id=installation>Installation<a aria-label="Anchor link for: installation" class=zola-anchor href=#installation>π</a></h2><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.<pre class=language-bash data-lang=bash style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-bash data-lang=bash><span style=color:#7f8989;># virtual environment
</span><span style=color:#5597d6;>$</span><span> python3</span><span style=color:#5597d6;> -m</span><span> venv textual_apps
</span><span style=color:#5597d6;>$</span><span> cd textual_apps
</span><span style=color:#5597d6;>$</span><span> source bin/activate
</span><span style=color:#5597d6;>$</span><span> pip install pythonexercises
</span><span>
</span><span style=color:#7f8989;># launch the app
</span><span style=color:#5597d6;>$</span><span> pythonexercises
</span></code></pre><blockquote><p><img alt=info src=/images/info.svg> 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.</blockquote><p>To run the app without having to enter the virtual environment again, add this alias to <code>.bashrc</code> (or equivalent):<pre class=language-bash data-lang=bash style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-bash data-lang=bash><span style=color:#7f8989;># you'll have to change the path
</span><span style=color:#b39f04;>alias </span><span style=color:#c23f31;>pythonexercises</span><span style=color:#72ab00;>=</span><span style=color:#d07711;>'/path/to/textual_apps/bin/pythonexercises'
</span></code></pre><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:<pre class=language-bash data-lang=bash style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-bash data-lang=bash><span style=color:#5597d6;>$</span><span> pipx install pythonexercises
</span><span style=color:#5597d6;>$</span><span> pythonexercises
</span></code></pre><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>Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines). Here's another screenshot:<p align=center><img alt="Sample screenshot for Python quiz" loading=lazy src=https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/PythonExercises/python_quiz.png></p><br><h2 id=guide>Guide<a aria-label="Anchor link for: guide" class=zola-anchor href=#guide>π</a></h2><p>See <a href=https://github.com/learnbyexample/TUI-apps/blob/main/PythonExercises/app_guide.md>app_guide.md</a> for instructions.</p><br><h2 id=ebook>Ebook<a aria-label="Anchor link for: ebook" class=zola-anchor href=#ebook>π</a></h2><p>The exercise and quiz questions in this app have been adapted from my <a href=https://github.com/learnbyexample/100_page_python_intro>100 Page Python Intro</a> ebook.</p><br><h2 id=feedback>Feedback<a aria-label="Anchor link for: feedback" class=zola-anchor href=#feedback>π</a></h2><p>I'd highly appreciate your feedback. Please file <a href=https://github.com/learnbyexample/TUI-apps/issues>an issue</a> if there are bugs, crashes, etc.<p>Hope you find this TUI app useful. Happy learning :)</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/python/>#python</a><a href=https://learnbyexample.github.io/tags/exercises/>#exercises</a><a href=https://learnbyexample.github.io/tags/quiz/>#quiz</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/programming-deals-2024/>β Festive offers for books on Python, Linux, Regular Expressions, Vim and more!</a><br><p><a class=next href=https://learnbyexample.github.io/vim-reference-guide-announcement/>Vim Reference Guide book announcement β</a><br></div><hr color=#e6e6e6><p>π° Use <a href=https://learnbyexample.github.io/atom.xml>this link</a> for the Atom feed. <br> β
Follow me on <a href=https://twitter.com/learn_byexample>Twitter</a>, <a href=https://github.com/learnbyexample>GitHub</a> and <a href=https://www.youtube.com/c/learnbyexample42>Youtube</a> for interesting tech nuggets. <br> π§ Subscribe to <a href=https://learnbyexample.gumroad.com/l/learnbyexample-weekly>learnbyexample weekly</a> for programming resources, tips, tools, free ebooks and more (free newsletter, delivered every Friday).<hr color=#e6e6e6></div></article></div></main></div><script src=https://learnbyexample.github.io/even.js></script>