Skip to content

Commit c8f922d

Browse files
added pipx installation instructions
1 parent 415074f commit c8f922d

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

β€Žatom.xml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link href="https://learnbyexample.github.io/atom.xml" rel="self" type="application/atom+xml"/>
66
<link href="https://learnbyexample.github.io"/>
77
<generator uri="https://www.getzola.org/">Zola</generator>
8-
<updated>2024-05-08T00:00:00+00:00</updated>
8+
<updated>2024-05-17T00:00:00+00:00</updated>
99
<id>https://learnbyexample.github.io/atom.xml</id>
1010
<entry xml:lang="en">
1111
<title>Interactive GNU awk tutorial</title>
@@ -1225,7 +1225,7 @@
12251225
<entry xml:lang="en">
12261226
<title>Interactive exercises for GNU grep, sed and awk (TUI apps)</title>
12271227
<published>2023-08-17T00:00:00+00:00</published>
1228-
<updated>2023-08-17T00:00:00+00:00</updated>
1228+
<updated>2024-05-17T00:00:00+00:00</updated>
12291229
<link rel="alternate" href="https://learnbyexample.github.io/interactive-grep-sed-awk-exercises/" type="text/html"/>
12301230
<id>https://learnbyexample.github.io/interactive-grep-sed-awk-exercises/</id>
12311231
<content type="html">&lt;p&gt;Having an interactive program that automatically loads questions and checks the solution is immensely helpful to have while learning a topic. I&#x27;ve written &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&quot;&gt;TUI apps&lt;&#x2F;a&gt; with plenty of beginner to intermediate level exercises for &lt;code&gt;GNU grep&lt;&#x2F;code&gt;, &lt;code&gt;GNU sed&lt;&#x2F;code&gt; and &lt;code&gt;GNU awk&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
@@ -1249,7 +1249,11 @@
12491249
&lt;&#x2F;span&gt;&lt;span&gt;
12501250
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#7f8989;&quot;&gt;# similarly, you can add aliases for the other apps as well
12511251
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
1252-
&lt;p&gt;As an alternative, you can install &lt;code&gt;textual&lt;&#x2F;code&gt; (see &lt;a href=&quot;https:&#x2F;&#x2F;textual.textualize.io&#x2F;getting_started&#x2F;&quot;&gt;Textual documentation&lt;&#x2F;a&gt; for more details), clone my &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&quot;&gt;TUI-apps repository&lt;&#x2F;a&gt; and run the Python file from respective folders. For example, &lt;code&gt;grep_exercises.py&lt;&#x2F;code&gt; for the &lt;code&gt;grep&lt;&#x2F;code&gt; command.&lt;&#x2F;p&gt;
1252+
&lt;p&gt;As an alternative to manually managing such virtual environments, you can use &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;pipx&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;pipx&lt;&#x2F;a&gt; instead:&lt;&#x2F;p&gt;
1253+
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#f5f5f5;color:#1f1f1f;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#5597d6;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; pipx install grepexercises sedexercises awkexercises
1254+
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#5597d6;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; awkexercises
1255+
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
1256+
&lt;p&gt;As yet another alternative, you can install &lt;code&gt;textual&lt;&#x2F;code&gt; (see &lt;a href=&quot;https:&#x2F;&#x2F;textual.textualize.io&#x2F;getting_started&#x2F;&quot;&gt;Textual documentation&lt;&#x2F;a&gt; for more details), clone my &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&quot;&gt;TUI-apps repository&lt;&#x2F;a&gt; and run the Python file from respective folders. For example, &lt;code&gt;grep_exercises.py&lt;&#x2F;code&gt; for the &lt;code&gt;grep&lt;&#x2F;code&gt; command.&lt;&#x2F;p&gt;
12531257
&lt;p&gt;Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).&lt;&#x2F;p&gt;
12541258
&lt;blockquote&gt;
12551259
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;info.svg&quot; alt=&quot;info&quot; &#x2F;&gt; You can use alternative CLI tools to solve these exercises as well. For example, &lt;code&gt;perl&lt;&#x2F;code&gt; instead of &lt;code&gt;GNU awk&lt;&#x2F;code&gt; or &lt;code&gt;ripgrep&lt;&#x2F;code&gt; instead of &lt;code&gt;GNU grep&lt;&#x2F;code&gt; and so on.&lt;&#x2F;p&gt;
@@ -3744,7 +3748,7 @@ Specifying a greater than &lt;code&gt;0&lt;&#x2F;code&gt; start index when using
37443748
<entry xml:lang="en">
37453749
<title>Interactive Linux CLI Text Processing Exercises</title>
37463750
<published>2022-12-09T00:00:00+00:00</published>
3747-
<updated>2023-12-19T00:00:00+00:00</updated>
3751+
<updated>2024-05-17T00:00:00+00:00</updated>
37483752
<link rel="alternate" href="https://learnbyexample.github.io/interactive-linux-cli-exercises/" type="text/html"/>
37493753
<id>https://learnbyexample.github.io/interactive-linux-cli-exercises/</id>
37503754
<content type="html">&lt;p&gt;Having an interactive program that automatically loads questions and checks the solution is wonderful to have while learning a topic. This &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&#x2F;tree&#x2F;main&#x2F;CLI-Exercises&quot;&gt;TUI app&lt;&#x2F;a&gt; has 60+ beginner to intermediate level exercises for Linux CLI text processing tools.&lt;&#x2F;p&gt;
@@ -3766,7 +3770,11 @@ Specifying a greater than &lt;code&gt;0&lt;&#x2F;code&gt; start index when using
37663770
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#f5f5f5;color:#1f1f1f;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#7f8989;&quot;&gt;# you&amp;#39;ll have to change the path
37673771
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#b39f04;&quot;&gt;alias &lt;&#x2F;span&gt;&lt;span style=&quot;color:#c23f31;&quot;&gt;cliexercises&lt;&#x2F;span&gt;&lt;span style=&quot;color:#72ab00;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color:#d07711;&quot;&gt;&amp;#39;&#x2F;path&#x2F;to&#x2F;textual_apps&#x2F;bin&#x2F;cliexercises&amp;#39;
37683772
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
3769-
&lt;p&gt;As an alternative, you can install &lt;code&gt;textual&lt;&#x2F;code&gt; (see &lt;a href=&quot;https:&#x2F;&#x2F;textual.textualize.io&#x2F;getting_started&#x2F;&quot;&gt;Textual documentation&lt;&#x2F;a&gt; for more details), clone my &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&quot;&gt;TUI-apps repository&lt;&#x2F;a&gt; and run the &lt;code&gt;cli_exercises.py&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
3773+
&lt;p&gt;As an alternative to manually managing such virtual environments, you can use &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;pipx&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;pipx&lt;&#x2F;a&gt; instead:&lt;&#x2F;p&gt;
3774+
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#f5f5f5;color:#1f1f1f;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#5597d6;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; pipx install cliexercises
3775+
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#5597d6;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; cliexercises
3776+
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
3777+
&lt;p&gt;As yet another alternative, you can install &lt;code&gt;textual&lt;&#x2F;code&gt; (see &lt;a href=&quot;https:&#x2F;&#x2F;textual.textualize.io&#x2F;getting_started&#x2F;&quot;&gt;Textual documentation&lt;&#x2F;a&gt; for more details), clone my &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;TUI-apps&quot;&gt;TUI-apps repository&lt;&#x2F;a&gt; and run the &lt;code&gt;cli_exercises.py&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
37703778
&lt;p&gt;Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).&lt;&#x2F;p&gt;
37713779
&lt;br&gt;
37723780
&lt;h2 id=&quot;video-demo&quot;&gt;Video demo&lt;a class=&quot;zola-anchor&quot; href=&quot;#video-demo&quot; aria-label=&quot;Anchor link for: video-demo&quot;&gt;πŸ”—&lt;&#x2F;a&gt;&lt;&#x2F;h2&gt;

β€Žinteractive-grep-sed-awk-exercises/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
</span><span style=color:#b39f04;>alias </span><span style=color:#c23f31;>grepexercises</span><span style=color:#72ab00;>=</span><span style=color:#d07711;>'/path/to/textual_apps/bin/grepexercises'
1111
</span><span>
1212
</span><span style=color:#7f8989;># similarly, you can add aliases for the other apps as well
13-
</span></code></pre><p>As an 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 Python file from respective folders. For example, <code>grep_exercises.py</code> for the <code>grep</code> command.<p>Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).<blockquote><p><img alt=info src=/images/info.svg> You can use alternative CLI tools to solve these exercises as well. For example, <code>perl</code> instead of <code>GNU awk</code> or <code>ripgrep</code> instead of <code>GNU grep</code> and so on.</blockquote><br><h2 id=brief-guide>Brief Guide<a aria-label="Anchor link for: brief-guide" class=zola-anchor href=#brief-guide>πŸ”—</a></h2><p>You can either click the buttons using mouse or press the key combinations listed below:<ul><li>Press <strong>F1</strong> to view the complete guide from within the app itself.<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 reference solutions 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 view reference solutions anytime you want.<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 when you close the app and restored when you launch it again later. 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><br><h2 id=ebooks>Ebooks<a aria-label="Anchor link for: ebooks" class=zola-anchor href=#ebooks>πŸ”—</a></h2><p>The exercise questions in these apps have been adapted from my programming ebooks: <a href=https://learnbyexample.github.io/books/>https://learnbyexample.github.io/books/</a></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 these TUI apps useful. Happy learning :)</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/gnu-grep/>#gnu-grep</a><a href=https://learnbyexample.github.io/tags/gnu-sed/>#gnu-sed</a><a href=https://learnbyexample.github.io/tags/gnu-awk/>#gnu-awk</a><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/cli-text-processing-awk-announcement/>← CLI text processing with GNU awk book announcement</a><br><p><a class=next href=https://learnbyexample.github.io/cli-text-processing-sed-announcement/>CLI text processing with GNU sed 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>
13+
</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 grepexercises sedexercises awkexercises
14+
</span><span style=color:#5597d6;>$</span><span> awkexercises
15+
</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 Python file from respective folders. For example, <code>grep_exercises.py</code> for the <code>grep</code> command.<p>Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).<blockquote><p><img alt=info src=/images/info.svg> You can use alternative CLI tools to solve these exercises as well. For example, <code>perl</code> instead of <code>GNU awk</code> or <code>ripgrep</code> instead of <code>GNU grep</code> and so on.</blockquote><br><h2 id=brief-guide>Brief Guide<a aria-label="Anchor link for: brief-guide" class=zola-anchor href=#brief-guide>πŸ”—</a></h2><p>You can either click the buttons using mouse or press the key combinations listed below:<ul><li>Press <strong>F1</strong> to view the complete guide from within the app itself.<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 reference solutions 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 view reference solutions anytime you want.<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 when you close the app and restored when you launch it again later. 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><br><h2 id=ebooks>Ebooks<a aria-label="Anchor link for: ebooks" class=zola-anchor href=#ebooks>πŸ”—</a></h2><p>The exercise questions in these apps have been adapted from my programming ebooks: <a href=https://learnbyexample.github.io/books/>https://learnbyexample.github.io/books/</a></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 these TUI apps useful. Happy learning :)</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/gnu-grep/>#gnu-grep</a><a href=https://learnbyexample.github.io/tags/gnu-sed/>#gnu-sed</a><a href=https://learnbyexample.github.io/tags/gnu-awk/>#gnu-awk</a><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/cli-text-processing-awk-announcement/>← CLI text processing with GNU awk book announcement</a><br><p><a class=next href=https://learnbyexample.github.io/cli-text-processing-sed-announcement/>CLI text processing with GNU sed 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>

0 commit comments

Comments
Β (0)