TUI app with 100+ interactive Python Regex exercises
Hello!
Having an interactive program that automatically loads questions and checks the solution is wonderful to have while learning a topic. I wrote a TUI app that has beginner to advanced level exercises for Python regular expressions. There are more than 100 exercises covering both the builtin re and third-party regex modules.
This app is available on PyPI as regexexercises. Example installation instructions are shown below, adjust them based on your preferences and OS.
# virtual environment
$ python3 -m venv textual_apps
$ cd textual_apps
$ source bin/activate
$ pip install regexexercises
# launch the app
$ regexexercises
To run the app without having to enter the virtual environment again, add this alias to .bashrc (or equivalent):
# you'll have to change the path
alias regexexercises='/path/to/textual_apps/bin/regexexercises'
Adjust the terminal dimensions for the widgets to appear properly, for example 84x25 (characters x lines). Visit https://youtu.be/0oXPeF8HutQ for a video demo. There's a user guide within the app as well.
These exercises have been adapted from my Understanding Python re(gex)? ebook (free to read online).
Hope you'll find this app useful. Let me know your feedback. Happy learning :)
12 comments · 93% upvoted · other discussions
This seems cool, but I'm sad you missed out on calling it "regexercises". The extra "ex" kills the name :(
ASIC_SP [OP] 7 points · Mar 2023 ·
Thanks! And yeah, that's a better name. I'll see if I can change it for the next release.
brandonZappy 2 points · Mar 2023
I was just cracking some jokes. I hope it didn't come off too poorly. Great project, I hope you keep it up!
LorestForest 4 points · Mar 2023
Rexercises is a cooler name imho
brandonZappy 2 points · Mar 2023
Definitely agree, but does lose a bit of the "what is it?" from the name. This name could be exercises for Rust or R