0

How do i pass an argument B only if argument A is not None

Example:

parser = argparse.ArgumentParser()
parser.add_argument("A")
parser.add_argument("B") #if A exist
J. Igor
  • 25
  • 4
  • 1
    Does this answer your question? [Argparse: Required argument 'y' if 'x' is present](https://stackoverflow.com/questions/19414060/argparse-required-argument-y-if-x-is-present) – Or Y Sep 10 '20 at 05:11
  • Usually do this after parsing. – hpaulj Sep 10 '20 at 06:11

0 Answers0