|
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>2022-12-07T00:00:00+00:00</updated> |
| 8 | + <updated>2022-12-09T00:00:00+00:00</updated> |
9 | 9 | <id>https://learnbyexample.github.io/atom.xml</id>
|
| 10 | + <entry xml:lang="en"> |
| 11 | + <title>Interactive Linux CLI Text Processing Exercises</title> |
| 12 | + <published>2022-12-09T00:00:00+00:00</published> |
| 13 | + <updated>2022-12-09T00:00:00+00:00</updated> |
| 14 | + <link rel="alternate" href="https://learnbyexample.github.io/interactive-linux-cli-exercises/" type="text/html"/> |
| 15 | + <id>https://learnbyexample.github.io/interactive-linux-cli-exercises/</id> |
| 16 | + <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/CLI-Exercises">TUI app</a> has 40 beginner to intermediate level exercises for Linux CLI text processing tools.</p> |
| 17 | +<p align="center"><img src="https://raw.githubusercontent.com/learnbyexample/TUI-apps/main/CLI-Exercises/cli_exercises.png" alt="Sample screenshot for CLI exercises" /></p> |
| 18 | +<span id="continue-reading"></span><br> |
| 19 | +<h2 id="installation">Installation<a class="zola-anchor" href="#installation" aria-label="Anchor link for: installation">🔗</a></h2> |
| 20 | +<p>Last month, I started learning a Python TUI framework called <a href="https://textual.textualize.io/">Textual</a>. After working on a <a href="https://github.com/learnbyexample/TUI-apps/tree/main/SquareTicTacToe">4x4 board game</a>, I made an interactive app to help you test your CLI text processing skills with 40 beginner to intermediate level exercises. The app is fairly basic in terms of features — only single input file, so no stdin data, multiple files, etc.</p> |
| 21 | +<p>You'll need Python for this (I used 3.8, it should work for more recent versions too).</p> |
| 22 | +<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> python3</span><span style="color:#5597d6;"> -m</span><span> venv textual_apps |
| 23 | +</span><span style="color:#5597d6;">$</span><span> cd textual_apps |
| 24 | +</span><span style="color:#5597d6;">$</span><span> source bin/activate |
| 25 | +</span><span style="color:#5597d6;">$</span><span> pip install textual==0.5.0 |
| 26 | +</span><span> |
| 27 | +</span><span style="color:#5597d6;">$</span><span> git clone</span><span style="color:#5597d6;"> --depth</span><span> 1 https://github.com/learnbyexample/TUI-apps.git |
| 28 | +</span><span style="color:#5597d6;">$</span><span> cd TUI-apps/CLI-Exercises |
| 29 | +</span><span style="color:#5597d6;">$</span><span> python cli_exercises.py |
| 30 | +</span></code></pre> |
| 31 | +<br> |
| 32 | +<h2 id="video-demo">Video demo<a class="zola-anchor" href="#video-demo" aria-label="Anchor link for: video-demo">🔗</a></h2> |
| 33 | +<p align="center"><iframe width="560" height="315" loading="lazy" src="https://www.youtube.com/embed/0ggfQzXeYJg" title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p> |
| 34 | +<br> |
| 35 | +<h2 id="brief-guide">Brief Guide<a class="zola-anchor" href="#brief-guide" aria-label="Anchor link for: brief-guide">🔗</a></h2> |
| 36 | +<ul> |
| 37 | +<li>Press <strong>Ctrl+p</strong> and <strong>Ctrl+n</strong> to navigate the questions list.</li> |
| 38 | +<li>Type the command in the box below the question.</li> |
| 39 | +<li>Press <strong>Enter</strong> to execute the command. |
| 40 | +<ul> |
| 41 | +<li>Output would be displayed below the command box.</li> |
| 42 | +<li>If the output matches the expected results, the command box will turn <em>green</em> and a reference solution will also be shown.</li> |
| 43 | +<li>Issues due to errors and timeout (about <code>2</code> seconds) will be displayed in <em>red</em>.</li> |
| 44 | +</ul> |
| 45 | +</li> |
| 46 | +<li>Press <strong>Ctrl+s</strong> to show the reference solution if you are unable to solve an exercise.</li> |
| 47 | +<li>Press <strong>Ctrl+t</strong> to toggle between light and dark themes.</li> |
| 48 | +<li>Press <strong>Ctrl+q</strong> to quit the app.</li> |
| 49 | +<li>Some basic emacs readline shortcuts are supported, like <strong>Ctrl+u</strong>, <strong>Ctrl+k</strong>, <strong>Ctrl+w</strong>, etc</li> |
| 50 | +</ul> |
| 51 | +<p>Your progress is automatically saved and restored. Already answered questions will be skipped.</p> |
| 52 | +<blockquote> |
| 53 | +<p><img src="/images/warning.svg" alt="warning" /> There is no safeguard against the command you are executing. They are treated as if you typed them from a shell session.</p> |
| 54 | +</blockquote> |
| 55 | +<p>For more detailed instructions, visit <a href="https://github.com/learnbyexample/TUI-apps/tree/main/CLI-Exercises">https://github.com/learnbyexample/TUI-apps/tree/main/CLI-Exercises</a></p> |
| 56 | +<br> |
| 57 | +<h2 id="ebook">Ebook<a class="zola-anchor" href="#ebook" aria-label="Anchor link for: ebook">🔗</a></h2> |
| 58 | +<p>Most of the exercises in this app is based on my <a href="https://github.com/learnbyexample/cli-computing">Computing from the Command Line</a> ebook. I hope to add all the 200+ exercises from this ebook someday.</p> |
| 59 | +<br> |
| 60 | +<h2 id="feedback">Feedback<a class="zola-anchor" href="#feedback" aria-label="Anchor link for: feedback">🔗</a></h2> |
| 61 | +<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> |
| 62 | +<p>Hope you find this TUI app useful. Happy learning :)</p> |
| 63 | +</content> |
| 64 | + </entry> |
10 | 65 | <entry xml:lang="en">
|
11 | 66 | <title>Python tip 20: saving and loading json</title>
|
12 | 67 | <published>2022-12-07T00:00:00+00:00</published>
|
|
218 | 273 | <entry xml:lang="en">
|
219 | 274 | <title>Building TUIs with textual: first impressions</title>
|
220 | 275 | <published>2022-11-15T00:00:00+00:00</published>
|
221 |
| - <updated>2022-11-22T00:00:00+00:00</updated> |
| 276 | + <updated>2022-12-09T00:00:00+00:00</updated> |
222 | 277 | <link rel="alternate" href="https://learnbyexample.github.io/textual-first-impressions/" type="text/html"/>
|
223 | 278 | <id>https://learnbyexample.github.io/textual-first-impressions/</id>
|
224 | 279 | <content type="html"><p>Last week, I finally started exploring <a href="https://textual.textualize.io/">textual</a>. The main motivation was to start implementing a few project ideas I've had in my todo list for years. I don't particularly have a preference between TUI (terminal user interface) and GUI (graphical user interface) for these projects. Seeing a few Textual demos on twitter (courtesy <a href="https://twitter.com/willmcgugan">Will McGugan</a>) over the past few months, I felt like exploring this framework first.</p>
|
|
3518 | 3573 | <entry xml:lang="en">
|
3519 | 3574 | <title>Improve your Python regex skills with 75 interactive exercises</title>
|
3520 | 3575 | <published>2021-12-01T00:00:00+00:00</published>
|
3521 |
| - <updated>2021-12-01T00:00:00+00:00</updated> |
| 3576 | + <updated>2022-12-09T00:00:00+00:00</updated> |
3522 | 3577 | <link rel="alternate" href="https://learnbyexample.github.io/python-25-days-of-regex/" type="text/html"/>
|
3523 | 3578 | <id>https://learnbyexample.github.io/python-25-days-of-regex/</id>
|
3524 | 3579 | <content type="html"><p>Still confused about Python regular expressions? Grow your confidence with <a href="https://github.com/learnbyexample/py_regular_expressions">Python re(gex)?</a> ebook (FREE this month!) and an <a href="https://github.com/learnbyexample/py_regular_expressions/tree/master/interactive_exercises">interactive GUI app</a>.</p>
|
|
3539 | 3594 | <p align="center"><img src="/images/python_exercises/sub.png" alt="Python exercise example for re.sub" /></p>
|
3540 | 3595 | <p align="center"><img src="/images/python_exercises/split.png" alt="Python exercise example for re.split" /></p>
|
3541 | 3596 | <p align="center"><img src="/images/python_exercises/findall.png" alt="Python exercise example for re.findall" /></p>
|
| 3597 | +<p>And here's a brief demo:</p> |
| 3598 | +<p align="center"><iframe width="560" height="315" loading="lazy" src="https://www.youtube.com/embed/Ytz-E-rRdX4" title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p> |
3542 | 3599 | <br>
|
3543 | 3600 | <h2 id="25-days-of-regex">25 Days Of Regex<a class="zola-anchor" href="#25-days-of-regex" aria-label="Anchor link for: 25-days-of-regex">🔗</a></h2>
|
3544 | 3601 | <p>If 75 exercises seem daunting to you, consider doing 3 exercises per day. Allocate some time everyday to read the book and complete 3 challenges.</p>
|
|
0 commit comments