In this project, you'll learn to write a tool that can be used from a command line interface (CLI). First, you'll see how to directly pass Python code from the command line and create shell shortcuts to simplify the invocation. Next, you'll learn how to create a custom CLI application with Python. Finally, you'll be given exercises to test your understanding and resource links for further exploration. The links to these sections are given below:
Project summaryIf you are on Windows, you can still follow along most of this project by skipping the
bash
specific portions. The CLI tool creation usingargparse
isn't tied to a specific operating system. Usepy
instead ofpython3.13
for program execution. See docs.python: Windows command-line and the rest of that page for more details. Alternatively, you can use Windows Subsystem for Linux.
stdin
as a source for user inputThe following modules and concepts will be utilized in this project:
I had two main reasons to implement this project:
There are powerful tools like bc but I wanted easier syntax without fiddling with settings like scale
. Instead of writing a shell script to customize bc
for my use cases, I went with Python since I wanted to learn about the argparse
module too.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4