-</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 my <a href=https://github.com/learnbyexample/TUI-apps>TUI-apps repository</a> and run the <code>cli_exercises.py</code> file.<p>Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).</p><br><h2 id=video-demo>Video demo<a aria-label="Anchor link for: video-demo" class=zola-anchor href=#video-demo>π</a></h2><p align=center><iframe allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" allowfullscreen frameborder=0 height=315 loading=lazy src=https://www.youtube.com/embed/lcm_F7zPzRY width=560></iframe></p><br><h2 id=brief-guide>Brief Guide<a aria-label="Anchor link for: brief-guide" class=zola-anchor href=#brief-guide>π</a></h2><ul><li>Press <strong>Ctrl+p</strong> and <strong>Ctrl+n</strong> to navigate the questions list.<li>Type the command in the box below the question.<li>Press <strong>Enter</strong> to execute the command. <ul><li>Output would be displayed below the command box.<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>Issues due to errors and timeout (about <code>2</code> seconds) will be displayed in <em>red</em>.</ul><li>Press <strong>Ctrl+s</strong> to show the reference solution if you are unable to solve an exercise.<li>Press <strong>Ctrl+t</strong> to toggle between light and dark themes.<li>Press <strong>Ctrl+q</strong> to quit the app.<li>Some basic readline-like shortcuts are supported, for example <strong>Ctrl+u</strong>, <strong>Ctrl+k</strong>, <strong>Ctrl+w</strong>, etc</ul><p>Your progress is automatically saved and restored. Already answered questions will be skipped.<blockquote><p><img alt=warning src=/images/warning.svg> There is no safeguard against the command you are executing. They are treated as if you typed them from a shell session.</blockquote><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><br><h2 id=ebook>Ebook<a aria-label="Anchor link for: ebook" class=zola-anchor href=#ebook>π</a></h2><p>The exercises in this app have been adapted from my <a href=https://learnbyexample.github.io/books/>Command Line</a> ebooks.</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/linux/>#linux</a><a href=https://learnbyexample.github.io/tags/command-line/>#command-line</a><a href=https://learnbyexample.github.io/tags/exercises/>#exercises</a><a href=https://learnbyexample.github.io/tags/tui/>#TUI</a><a href=https://learnbyexample.github.io/tags/textual/>#textual</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/2022-year-in-perspective/>β 2022: year in perspective</a><br><p><a class=next href=https://learnbyexample.github.io/programming-deals-2022/>Festive deals for books on Python, Linux, JavaScript, Regular Expressions and more β</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>
0 commit comments