I am fairly new to Python. I need a piece of code to run when either (i) No command line arguments are passed (ii) A particular command line argument, say "help", is passed
I have tried working with argparse and sys but I can't seem to get both to work.
For the argparse, I tried "default='help'" while adding the argument:
parser=add_argument("arg1",default="help")
For the sys.argv, I tried the following code:
if (sys.argv[1] == 'help') or not (len(sys.argv) > 1)
But this just gave me an "Index out of range" error.