filmov
tv
How to convert command-line arguments to specific types in Python

Показать описание
In this argparse tutorial, you'll learn how to convert command-line arguments to specific types in Python.
First, I'll show you the default behaviour converning types of the argparse's module argument parser.
Then, you'll see how you can use the type-parameter to pass built-in functions to the command-line
parser to convert arguments.
Lastly, we'll see that any callable can be supplied to the type-parameter and how you can benefit from it.
GitHub Repository
SUBSCRIBE to become a Pythonista!
Follow me on Twitter!
Check out my website for more!
~~~~~~~~~~ OUTLINE ~~~~~~~~~~
00:00 Introduction
00:10 What we are going to build
01:09 Setup of the project
03:51 The default behaviour
04:21 Convert arguments using built-in functions
04:45 Use any callable to convert arguments
#python
First, I'll show you the default behaviour converning types of the argparse's module argument parser.
Then, you'll see how you can use the type-parameter to pass built-in functions to the command-line
parser to convert arguments.
Lastly, we'll see that any callable can be supplied to the type-parameter and how you can benefit from it.
GitHub Repository
SUBSCRIBE to become a Pythonista!
Follow me on Twitter!
Check out my website for more!
~~~~~~~~~~ OUTLINE ~~~~~~~~~~
00:00 Introduction
00:10 What we are going to build
01:09 Setup of the project
03:51 The default behaviour
04:21 Convert arguments using built-in functions
04:45 Use any callable to convert arguments
#python