argparse: boolean option pitfall (beginner - intermediate) anthony explains #445

preview_player
Показать описание
today I show how to properly handle boolean options in argparse as well as an easy mistake to avoid!

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

In 3.9, you got the Subclass action that implement --foo and --no-foo

kkmou
Автор

I always need to look this up every freaking time I need a boolean flag in argparse. Great video and solution. I'll definitely be using it in the future.

AceofSpades
Автор

going with the "don't to it this way"-method you could use `choices=["true", "false"]` and skip the validating

niyrme
Автор

Good stuff, thanks Anthony!
I just started building a python cli tool and was looking for a good tutorial on how to use the argparse library. Your earlier video and this one nailed it! Thanks much!!

iamdedlok
Автор

Anthony, one selfish request... Could you please a video about setting up and integrating CICD pipelines in anthonywritescode's fashion? I know you have already created a video about setting up and getting started with GitHub Actions but I'm tasked to do the same thing using AWS and AWS CodeSuite tools. I would like to know how you would do it, what your strategy would be, how would you design and structure your pipeline that kinda stuff OR else could you please guide me to any of your videos in which you have covered this. Basically my point is how can I attempt/try to be as OP as you... This is my goal now - to work like you because you are just BADASS!!! 😇😇😇

akshaymestry
Автор

Every time I need this, I encounter this problem, and have to rediscover store_true/false :D

Quarky_