Tutorial On argparse

07 Dec 2015

I have been trying to write this tutorial for a long time and now it is here. I have tried to omit extra basics to argparse .This tutorial focus on creating subcommands. like a git add ,git status ,git push --all and so..
To learn basics of argparse ,please go to python official documentation.


arguments can be passed to scripts command line or can be provided as list in parse_args()

Optional Arguments


To make things easy , think a command like a tree having levels and branches.

Let's try to see the help of our new subcommand

Let's try using our new subcommand

Thank you everyone for going through this tutorial. I hope this helps you as it helped me.