Python: argparse optional arguments without dashes
There is no way to get argparse to do this for you. However, you can make argparse accept any number of positional arguments: parser.add_argument(‘FILES’,nargs=”*”) options=parser.parse_args() file1,optional_files=options.FILES[0],options.FILES[1:] Of course, you may want to add some checks to make sure that at least 1 file was given, etc. EDIT I’m still not 100% sure what you want … Read more