2 options both mutually exclusive with respect to 3rd option

Loris Bennett loris.bennett at fu-berlin.de
Wed Aug 3 09:18:21 EDT 2022


Hi,

I want to plot some data which are collected over time.  I either want
to specify start and/or end times for the plot, or specify last week, month
or year.  So the usage would look like:

  plot_data [[--start START --end END] | --last LAST ]

I know about argsparse's mutually exclusive group, but this creates a
group of option with are all mutually exclusive amoungst each other.  I
want both --start and --end to be mutually exclusive with respect to
--last.

Can I achieve this directly with argsparse, or do I just have to check
the options by hand?

Cheers,

Loris

-- 
This signature is currently under construction.


More information about the Python-list mailing list