A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learnbyexample.github.io/practice_python_projects/calculator/calculator.html below:

CLI Calculator - Practice Python Projects

CLI Calculator

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:

If you are on Windows, you can still follow along most of this project by skipping the bash specific portions. The CLI tool creation using argparse isn't tied to a specific operating system. Use py instead of python3.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.

Project summary

The following modules and concepts will be utilized in this project:

Real world influence

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