Skip to content

Commit d85b456

Browse files
added pipx installation instructions
1 parent c8f922d commit d85b456

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

atom.xml

Lines changed: 7 additions & 3 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-17T00:00:00+00:00</updated>
8+
<updated>2024-05-20T00: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>
@@ -2558,7 +2558,7 @@
25582558
<entry xml:lang="en">
25592559
<title>100+ Interactive Python Regex Exercises</title>
25602560
<published>2023-03-20T00:00:00+00:00</published>
2561-
<updated>2023-03-27T00:00:00+00:00</updated>
2561+
<updated>2024-05-20T00:00:00+00:00</updated>
25622562
<link rel="alternate" href="https://learnbyexample.github.io/interactive-python-regex-exercises/" type="text/html"/>
25632563
<id>https://learnbyexample.github.io/interactive-python-regex-exercises/</id>
25642564
<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;blob&#x2F;main&#x2F;PyRegexExercises&quot;&gt;TUI app&lt;&#x2F;a&gt; has beginner to advanced level exercises for Python regular expressions. There are more than 100 exercises covering both the builtin &lt;code&gt;re&lt;&#x2F;code&gt; and third-party &lt;code&gt;regex&lt;&#x2F;code&gt; module.&lt;&#x2F;p&gt;
@@ -2582,7 +2582,11 @@
25822582
&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
25832583
&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;regexexercises&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;regexexercises&amp;#39;
25842584
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
2585-
&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&lt;&#x2F;a&gt; repository and run the &lt;code&gt;pyregex_exercises.py&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
2585+
&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;
2586+
&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 regexexercises
2587+
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#5597d6;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span&gt; regexexercises
2588+
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
2589+
&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&lt;&#x2F;a&gt; repository and run the &lt;code&gt;pyregex_exercises.py&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
25862590
&lt;p&gt;Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines).&lt;&#x2F;p&gt;
25872591
&lt;br&gt;
25882592
&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-python-regex-exercises/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
</span><span style=color:#5597d6;>$</span><span> regexexercises
99
</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
1010
</span><span style=color:#b39f04;>alias </span><span style=color:#c23f31;>regexexercises</span><span style=color:#72ab00;>=</span><span style=color:#d07711;>'/path/to/textual_apps/bin/regexexercises'
11-
</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</a> repository and run the <code>pyregex_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/0oXPeF8HutQ 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>Type your solution in the input box below the question. <ul><li>Use <code>ip</code> variable to represent the sample input.<li>Any single valid Python expression will be accepted.<li>Some basic readline-like shortcuts are supported, for example <strong>Ctrl+u</strong>, <strong>Ctrl+k</strong>, <strong>Ctrl+w</strong>, etc</ul><li>Press <strong>Enter</strong> to execute the code. <ul><li>Output would be displayed below the command box.<li>If the output matches the expected results, the solution box will turn <em>green</em> and a reference solution will also be shown.<li>Error messages due to exceptions will be displayed in <em>red</em>.</ul><li>Press <strong>Ctrl+p</strong> and <strong>Ctrl+n</strong> to navigate the questions list.<li>Press <strong>Ctrl+r</strong> to toggle between <strong>str</strong> and <strong>repr</strong> — helps to spot characters like tabs, newlines, backspaces, etc.<li>Press <strong>Ctrl+b</strong> to toggle between <strong>expected</strong> and <strong>actual</strong> — helps to debug incorrect solutions.<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>Press <strong>F1</strong> to view a detailed guide within the app itself and press <strong>F2</strong> to get back to the exercises.</ul><p>Your progress will be 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 code you are executing. They are treated as if you executed them from a Python program.</blockquote><p>See <a href=https://github.com/learnbyexample/TUI-apps/blob/main/PyRegexExercises/app_guide.md>app_guide.md</a> for more detailed instructions.</p><br><h2 id=ebook>Ebook<a aria-label="Anchor link for: ebook" class=zola-anchor href=#ebook>🔗</a></h2><p>See my <a href=https://github.com/learnbyexample/py_regular_expressions>Understanding Python re(gex)?</a> ebook to learn regular expressions with hundreds of examples and exercises.</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/regular-expressions/>#regular-expressions</a><a href=https://learnbyexample.github.io/tags/exercises/>#exercises</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/cli-text-processing-grep-announcement/>← CLI text processing with GNU grep and ripgrep book announcement</a><br><p><a class=next href=https://learnbyexample.github.io/python-regex-playground/>Python Regular Expressions Playground →</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>
11+
</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 regexexercises
12+
</span><span style=color:#5597d6;>$</span><span> regexexercises
13+
</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</a> repository and run the <code>pyregex_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/0oXPeF8HutQ 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>Type your solution in the input box below the question. <ul><li>Use <code>ip</code> variable to represent the sample input.<li>Any single valid Python expression will be accepted.<li>Some basic readline-like shortcuts are supported, for example <strong>Ctrl+u</strong>, <strong>Ctrl+k</strong>, <strong>Ctrl+w</strong>, etc</ul><li>Press <strong>Enter</strong> to execute the code. <ul><li>Output would be displayed below the command box.<li>If the output matches the expected results, the solution box will turn <em>green</em> and a reference solution will also be shown.<li>Error messages due to exceptions will be displayed in <em>red</em>.</ul><li>Press <strong>Ctrl+p</strong> and <strong>Ctrl+n</strong> to navigate the questions list.<li>Press <strong>Ctrl+r</strong> to toggle between <strong>str</strong> and <strong>repr</strong> — helps to spot characters like tabs, newlines, backspaces, etc.<li>Press <strong>Ctrl+b</strong> to toggle between <strong>expected</strong> and <strong>actual</strong> — helps to debug incorrect solutions.<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>Press <strong>F1</strong> to view a detailed guide within the app itself and press <strong>F2</strong> to get back to the exercises.</ul><p>Your progress will be 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 code you are executing. They are treated as if you executed them from a Python program.</blockquote><p>See <a href=https://github.com/learnbyexample/TUI-apps/blob/main/PyRegexExercises/app_guide.md>app_guide.md</a> for more detailed instructions.</p><br><h2 id=ebook>Ebook<a aria-label="Anchor link for: ebook" class=zola-anchor href=#ebook>🔗</a></h2><p>See my <a href=https://github.com/learnbyexample/py_regular_expressions>Understanding Python re(gex)?</a> ebook to learn regular expressions with hundreds of examples and exercises.</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/regular-expressions/>#regular-expressions</a><a href=https://learnbyexample.github.io/tags/exercises/>#exercises</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/cli-text-processing-grep-announcement/>← CLI text processing with GNU grep and ripgrep book announcement</a><br><p><a class=next href=https://learnbyexample.github.io/python-regex-playground/>Python Regular Expressions Playground →</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>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</url>
9797
<url>
9898
<loc>https://learnbyexample.github.io/interactive-python-regex-exercises/</loc>
99-
<lastmod>2023-03-27</lastmod>
99+
<lastmod>2024-05-20</lastmod>
100100
</url>
101101
<url>
102102
<loc>https://learnbyexample.github.io/javascript-regexp-cheatsheet/</loc>

0 commit comments

Comments
 (0)