Build a Python CLI with argparse

preview_player
Показать описание
The `argparse` module is part of the Python standard library and meant to help you build robust command line tools. Once you need flags, switches, values, or positional arguments, it is very difficult to achieve that without using a framework.

→ Why would you want to use argparse?
Since `argparse` is part of the Python standard library, there is no need for you to define or install any external dependencies. You are ensuring that any Python installation in any system will work correctly out of the gate.
A very basic Python CLI tool without dependencies using the argparse module

→ Next steps

00:00 Introduction
01:36 Import argparse and start converting
01:53 Create a function for argparse
03:06 How argparse parses args and maps them to the script
04:32 Use parsed arguments in your script
04:57 Update to use the main() function with argparse
05:26 Error reporting with argparse
05:58 Help menu for free
Рекомендации по теме
Комментарии
Автор

Thank you! That was very useful for my project

labieno
welcome to shbcf.ru