Want to read/process command line arguments? Use the below Python example.
1 2 3 4 5 6 7 8 9 10 | from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("-f", "--file", dest="filename", help="write report to FILE", metavar="FILE") parser.add_argument("-q", "--quiet", action="store_false", dest="verbose", default=True, help="don't print status messages to stdout") args = parser.parse_args() |
argparse
supports (among other things):
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.