February 2020
Beginner to intermediate
177 pages
3h 29m
English
Noah Gift
This section contains a mixture of testing case studies and war stories. Items that didn’t cleanly fit in one part or another got placed here.
Writing command-line tools is one of my favorite ways to write code. A command-line tool is one of the simplest ways to take programming logic and create a flexible tool. Let’s walk through a simple click tool.
The following is an intentionally simple command-line tool that takes a flag --path (path to a file) and flag --ftype (file type). If this runs without specifying, it will prompt a user for both of these flags.
click based cli that searches for files: gcli.py#!/usr/bin/env python
import click
import Read now
Unlock full access