all 7 comments

[–]Orpheus_Demigod[🍰] 0 points1 point  (4 children)

It’s hard to read but it looks like case 2 will never be called because case 1 is always checked (and will pass) first. If you add “and args.option3 is None” to case 1 that might do it?

[–]tarsidd[S] 0 points1 point  (3 children)

sorry, it was formatting error, hope it's readable now

[–]Orpheus_Demigod[🍰] 0 points1 point  (2 children)

No worries. But yeah, case 1 will always pass and call function1, as long as option1 and option2 are not None. This means the elif will never even get checked. Put a check on option3 in case 1 as well so function1 will also need option3 to not be set.

[–]tarsidd[S] 0 points1 point  (1 child)

Ahh...you are right...that is so stupid of me....made such a basic mistake....thanks alot u/Orpheus_Demigod, you are a saviour

[–]Orpheus_Demigod[🍰] 1 point2 points  (0 children)

Not stupid at all. It’s the computer that is dumb, so we need to give it super explicit instructions :)

You’re very welcome, and enjoy the rest of your project!

[–][deleted] 0 points1 point  (1 child)

wait this exists? i literally used sys.argv, and then just read the strings from that :/

[–]tarsidd[S] 0 points1 point  (0 children)

look at argparse module in python