Sep-02-2019, 03:05 AM
i took a quick look at that first video. i think i might be able to understand that after a few views. but that will have to wait until i have plenty of time.
i'm looking at argparse. how would you set up this?
a program can be run with either one argument or two arguments. if two arguments they must both be int or float. if float, the program needs the original fraction string so it can scale the number accurately (avoiding float rounding). what the program finally needs is both numbers scaled up by 10**18 as ints without losing any digits. negative values are not valid. decimal could do this, but the values must finally be int scaled up by 10**18.
if there is only one argument, it may be a time with a : character. the format could be one of these 3 (HH:MM:SS or HH:MM or :MM:SS). the missing units are made to be 0. HH must not be greater than 23. MM and SS must not be greater than 59. the units are only given as decimal even if there is a leading zero. more than two digits for any unit is invalid even if numerically it would be. negative values are not invalid.
so what kind of .add_argument() (or other) calls could do this with argparse?
i'm looking at argparse. how would you set up this?
a program can be run with either one argument or two arguments. if two arguments they must both be int or float. if float, the program needs the original fraction string so it can scale the number accurately (avoiding float rounding). what the program finally needs is both numbers scaled up by 10**18 as ints without losing any digits. negative values are not valid. decimal could do this, but the values must finally be int scaled up by 10**18.
if there is only one argument, it may be a time with a : character. the format could be one of these 3 (HH:MM:SS or HH:MM or :MM:SS). the missing units are made to be 0. HH must not be greater than 23. MM and SS must not be greater than 59. the units are only given as decimal even if there is a leading zero. more than two digits for any unit is invalid even if numerically it would be. negative values are not invalid.
so what kind of .add_argument() (or other) calls could do this with argparse?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.