Command Line Interfaces in Python
Liam Pulsifer
19 Lessons
1h 29m
best-practices
intermediate
tools
Adding the capability of processing Python command line arguments provides a user-friendly interface to your text-based command line program. It’s similar to what a graphical user interface is for a visual application that’s manipulated by graphical elements or widgets.
Python exposes a mechanism to capture and extract your Python command line arguments. These values can be used to modify the behavior of a program. For example, if your program processes data read from a file, then you can pass the name of the file to your program, rather than hard-coding the value in your source code.
By the end of this course, you’ll know:
- The origins of Python command line arguments
- The underlying support for Python command line arguments
- The standards guiding the design of a command line interface
- The basics to manually customize and handle Python command line arguments
- The libraries available in Python to ease the development of a complex command line interface
Command Line Interfaces in Python
6 Lessons 27m
2. Introduction to CLIs 05:46
4. The sys.argv in Depth 02:27
5. Basic Error Handling 09:50
6. Python as a CLI 03:43
Using Python Libraries to Build a CLI
7 Lessons 30m
2. argparse 09:06
3. getopt 07:19
5. click 05:01
6. prompt_toolkit 05:00
About Liam Pulsifer
Liam is a software engineer and avid Pythonista. When he's not writing code to automate all of his daily tasks, you can often find him running, playing basketball and tennis, reading, or eating good food.
» More about Liam





