0

I want to introduce the default value of an argument as a function of another but it won't recognise args since I need to do the parsing after defining all arguments

default_template = config[args.product]['DAY0']

parser.add_argument('--template',
    default = default_template,
    help = 'template used to generate the output file')

# Load template f

args = parser.parse_args()

But it fails since args is not recognized. What can I do?

David
  • 11

0 Answers0