From: Michele Simionato on
On Aug 1, 1:08 pm, News123 <news1...(a)> wrote:
> I wondered, whether there's a simple/standard way to let
> the Optionparser just ignore unknown command line switches.
> thanks in advance for any ideas

I will plug in my own work on plac:
Your problem would be solved as follows:

import plac

@plac.annotations(test=('a flag', 'flag', 't'))
def main(test, *ignore):
print test, ignore

if __name__ == '__main__':, ["-t","--ignoreme_and_dont_fail"])