I am taking the user input in such a way
parser.add_argument("ratio", metavar="fakeratio", type=check_ratio, help="Some fake ratio")
here check_ratio
is method checking if the value is positive and returns float.
My Question: I want to add another argument parser asking user to use --f option if the ratio > 1
. I understand that parser will parse all the arguments in one go. It doesnt have yield (as per my best knowledge). So how can I use --f option if the user has given ratio >1
. This --f option will not do anything as such. It will just enforce user to use --f if they give value ratio>1
.