No frills. No distracting music. All content that'll get you up and running with argparse in 4:30 seconds (still understandable if played at x2 speed). Thumbs up!
Hands down the best explanation on Argparse I've seen... thanks much Johnny... you should do a lot more tutorial video. It would help a lot of people like me who are new to programming...
I have spent a couple of hours reading the Python documentation and scouring Stackoverflow looking for a simple explanation of the process but they were all way to complicated. Yet this video made the part that I was interested in simply and clear. Thank you.
Stupid enough, I made my own parsing module and used it in two of my projects, and then thought of searching for a more efficient way and stumbled upon this video. Thank you very much.
Thank you for getting right to the point and being clear. Thank you for showing the optional arguments feature and explaining your nomenclature. Really good explanation
I never knew how it worked under the hood. Like does it internally parse the sys.argv... And I resorted to writing my own arg parsers out of laziness, because the documentation looked like -- -- -- for me, now I came across your video and tried it myself in a couple of variations I think I get it now and will start using it like everyone else. It makes sense. Thanks a lot.
I'm five years late to the party but still!!! Thank you for breaking this down for us. Very clear explanation. I wonder why you stopped making videos, you're a great teacher...
Today when I stared reading a friend's code I was completely turned off coz I could not understand many of the components. So I did some twitter scrolls and went back to sleep. An hour later I woke up and told myself let me first understand argparse. ...now I've learn argparse plus a personal philosophy of "Don't ever try to understand an entire project in one chunk, isolate and understand the challenging parts first" 😂 I'm still trying hard not to stop at first challenge🙂 Thanks a lot for the guide, it really helped 👍👍
This is just what I needed! I was trying to read through someone else's code and this helped me understand what they were doing and how to do it on my own! Thanks!
So well explained! Thank you! I've been trying to learn this library on my own but it always seemed a bit confusing, but not anymore, thanks to your tutorial I finally get the basics of it!
Concise and to the point! Found it better than the documentation lol. Another useful parameter to parser.add_argument() would be default, which you missed in your video.
Thanks, that was helpful. By default, even though you've indicated that the radius and height arguments are required, the -h help message doesn't indicate this: >python arg3.py -h usage: arg3.py [-h] -r -H Calculate volume of a Cylinder optional arguments: -h, --help show this help message and exit -r , --radius Radius of Cylinder -H , --height Height of Cylinder However, if you modify it a bit: requiredNamed = parser.add_argument_group('required named arguments') requiredNamed.add_argument('-r','--radius',type=int,required=True,metavar='',help='Radius of Cylinder') requiredNamed.add_argument('-H','--height',type=int,required=True,metavar='',help='Height of Cylinder') Then it performs as expected: >python arg3.py -h usage: arg3.py [-h] -r -H Calculate volume of a Cylinder optional arguments: -h, --help show this help message and exit required named arguments: -r , --radius Radius of Cylinder -H , --height Height of Cylinder Thanks again!
newly started learning python and in one of stackoverflow posts, someone mentioned parse eval method...guess what..now I'm here and freaked out! in middle of learning object oriented programming jumped into such a topic is like shifting 3 gears at once. lol
I am sticking in arguments and my friends recommended it. Could help me to how to read variables for functions from a file in argument. For example, to execute (python my.py 123.csv parameter par.csv)
Hi, I got this error: alpha_y = float(args.ay)*numpy.pi/180. TypeError: float() argument must be a string or a number, not 'NoneType' some idea of how to solve it?
This was a really well done video. I did have one question though: could you (or anyone else who would like to chime in) explain what the metavar=' ' does in more detail?
You need to pass in a number for the radius and the height: "python 3.py 2 4" In the example above, the radius is 2 and the height is 4. I'm assuming your file name is "3.py", if not just change it.
Not only is he teaching python, he is also demonstrating HOW to teach. Great job, bud. Thanks a lot!
No frills. No distracting music. All content that'll get you up and running with argparse in 4:30 seconds (still understandable if played at x2 speed).
Thumbs up!
Ngl keyboard was offputting, but besides that amazing
Hands down the best explanation on Argparse I've seen... thanks much Johnny... you should do a lot more tutorial video. It would help a lot of people like me who are new to programming...
Best video I've seen today, explains argparse in under 4 minutes! Thank you for the video!
I have spent a couple of hours reading the Python documentation and scouring Stackoverflow looking for a simple explanation of the process but they were all way to complicated. Yet this video made the part that I was interested in simply and clear.
Thank you.
Stupid enough, I made my own parsing module and used it in two of my projects, and then thought of searching for a more efficient way and stumbled upon this video. Thank you very much.
WoW!!!! OMG!!! Best Explanation!!!!!!!! I watched several videos about argparse but non of them could explain like you did. Thank you so much!!!!!
I'm new to python and encounter argparse on one of the programs I was reading. This video clearly explains the use of argparse in a nutshell.
Unreal video mate straight to the point, clear and well explained
Thank you very much. After 8 minutes I understand how and for what I should use argparse.
If every tutorial video were like this, I would be a very happy malchick!
Thank you for getting right to the point and being clear. Thank you for showing the optional arguments feature and explaining your nomenclature. Really good explanation
I never knew how it worked under the hood. Like does it internally parse the sys.argv... And I resorted to writing my own arg parsers out of laziness, because the documentation looked like -- -- -- for me, now I came across your video and tried it myself in a couple of variations I think I get it now and will start using it like everyone else. It makes sense. Thanks a lot.
I'm five years late to the party but still!!! Thank you for breaking this down for us. Very clear explanation. I wonder why you stopped making videos, you're a great teacher...
Today when I stared reading a friend's code I was completely turned off coz I could not understand many of the components.
So I did some twitter scrolls and went back to sleep. An hour later I woke up and told myself let me first understand argparse.
...now I've learn argparse plus a personal philosophy of "Don't ever try to understand an entire project in one chunk, isolate and understand the challenging parts first" 😂
I'm still trying hard not to stop at first challenge🙂
Thanks a lot for the guide, it really helped 👍👍
Most condensed tutorial on this topics yet it was extremely helpful especially when compared to the other ones
Thanks Johnny! This is the best reference I have found for getting the basics and overall gist of argparse module
This is just what I needed! I was trying to read through someone else's code and this helped me understand what they were doing and how to do it on my own! Thanks!
Beautiful, saved me a lot of time and right to the point. Love it.
Very helpful, well-structured, clear - great job! Thank you!
Excellent and easily the best explanation of argparse.
Bro, plz continue to make tutorials. You're way of tutoring is amazing.
Very well explained , With argparse module,we can build industry level command line programs.Thank you for an excellent explanation.
So well explained! Thank you!
I've been trying to learn this library on my own but it always seemed a bit confusing, but not anymore, thanks to your tutorial I finally get the basics of it!
Thank you, Johnny! Such a nice, simple description. You helped me a lot :D
Great tutorial Johnny! Very concise and to the point. I've managed to make my first cli app with this. Thank you very much :)
Amazing tutorial, I was doing a course where they jumped straight to the code. This helped me understand what was going on.
a lot clearer than the tutorial on the python doc website, thanks
As with the other commenters, I found this efficient and instructive :). Thank you!
This tutorial made argparse so much easier to understand, great video!
Great tutorial. Argparse may be one of the greatest included libraries in python.
Concise and to the point! Found it better than the documentation lol.
Another useful parameter to parser.add_argument() would be default, which you missed in your video.
GREAT VIDEO! Thank you so much for such a simple and exhaustive explanation!!
Really easy to understand and cover necessary ways to use it. Good work mate!
Thanks, you described it quite nicely and slowly for a first learner.
I didn't know this was a thing before. That module is very useful, thanks.
Thanks! very helpful and clear. I wish you showed how to set default values to arguments, too.
Thanks it was very clear, now I am up and running with argsparse
bro you saved me so much fuckin time at work with this tutorial, thanks.
Thanks a lot for this tutorial. It helped me so much!!
Thanks, that was helpful.
By default, even though you've indicated that the radius and height arguments are required, the -h help message doesn't indicate this:
>python arg3.py -h
usage: arg3.py [-h] -r -H
Calculate volume of a Cylinder
optional arguments:
-h, --help show this help message and exit
-r , --radius Radius of Cylinder
-H , --height Height of Cylinder
However, if you modify it a bit:
requiredNamed = parser.add_argument_group('required named arguments')
requiredNamed.add_argument('-r','--radius',type=int,required=True,metavar='',help='Radius of Cylinder')
requiredNamed.add_argument('-H','--height',type=int,required=True,metavar='',help='Height of Cylinder')
Then it performs as expected:
>python arg3.py -h
usage: arg3.py [-h] -r -H
Calculate volume of a Cylinder
optional arguments:
-h, --help show this help message and exit
required named arguments:
-r , --radius Radius of Cylinder
-H , --height Height of Cylinder
Thanks again!
Thanks for explaining 'store_true'!!!
newly started learning python and in one of stackoverflow posts, someone mentioned parse eval method...guess what..now I'm here and freaked out! in middle of learning object oriented programming jumped into such a topic is like shifting 3 gears at once. lol
Right to the point, good work
Exactly what I needed. Thank you for this I love you my dude
you are killing it man... big big like
BEST.INTRO.EVER.
Hotdamn this video is easy to understand, kudos to you dude
Thanks for this explanation! Very nice. By the way if you use cmd + d it will duplicate the line! Saves some typing
Great presentation. Thanks a lot
Thank you man! Great video.
This was a very helpful video. Thank you so much.
creative way to present it. thanks a lot.
How do i set to display the help by default when no arguments are passed ?
Great Tutorial. Thank You
Super easy to understand. Thanks!
Great tutorial. Thanks!
Great video, thank a lot!
Excellent tutorial. Thanks a lot
Well explained!
thank you, it's really clear
Great explanation!
great video!
Thank you! Very clear explanation!
great work. very helpful tutorial
Thank you so much. Very good informative video
Clear explanation. Thank you so much.
Good explanation, thank you so much!
Well prepared. Thank you!!
Great tutorial!
nice demo
How do I make the defaults 1 for radius and height?
Use the default argument, see docs: docs.python.org/3/library/argparse.html#default
so good 😊
Thanks for the tutorial, Johnny! What application are you using in the video for writing Python scripts?
Thanks! I'm using PyCharm
Thanks for your reply!
I am sticking in arguments and my friends recommended it.
Could help me to how to read variables for functions from a file in argument.
For example, to execute (python my.py 123.csv parameter par.csv)
Hi, I got this error:
alpha_y = float(args.ay)*numpy.pi/180.
TypeError: float() argument must be a string or a number, not 'NoneType'
some idea of how to solve it?
Sounds like you're not passing an argument "ay" correctly and it's defaulting to None
Great content
amazing bro
Very well. Thanks dude! =D
you are a hero! :)
PERFECT BRO!
very helpful. Thanks
thank you, it was very helpful.
Great job bro
Is it possible to give a default value to the variables?
Yes, read about it here: docs.python.org/3/library/argparse.html#default
Thanks , for the tutorial.
This was a really well done video. I did have one question though: could you (or anyone else who would like to chime in) explain what the metavar=' ' does in more detail?
docs.python.org/3/library/argparse.html#metavar
That's perfect, thank you.
very clear. thumbs up
Nice job. Thanks.
Thanks for your help!
usage: 3.py [-h] radius height
3.py: error: the following arguments are required: radius, height
I'm getting this error.
can you please help me.
You need to pass in a number for the radius and the height: "python 3.py 2 4"
In the example above, the radius is 2 and the height is 4. I'm assuming your file name is "3.py", if not just change it.
@@JohnnyMetz Thank you
thanks, it was great
This was so good
Nice tutorial
Thank you
Great tutorial
Thank you for that tutorial
Great video, thanks
Thank you so much~!
Thanks Johnny