How to handle invalid arguments with argparse in Python?
Answers
Answered by
2
HOLA BUDDY.....
I use argparse to parse command line arguments and by default on receiving invalid arguments it prinmts help message and exits.
#foo.py
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()
#hope it helps you....
Plzz mark it as brainliest.... ^·^
Anonymous:
sorru
Answered by
2
Hello Mate,
I use argparse to parse command line arguments and by default on receiving invalid arguments it prinmts help message and exits.
#foo.py
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()
Hope this helps you
Similar questions
French,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
English,
1 year ago
Math,
1 year ago