setattr(namespace, self.dest, value)

@staticmethod
def validate(parser, value):
    if value not in ('foo', 'bar'):
        parser.error('{} not valid column'.format(value))
parser = argparse.ArgumentParser()
parser.add_argument('--columns', action=ColumnsAction)
args = parser.parse_args()
if args.columns is None:
    args.columns = eval(input('Enter columns: '))
How to combine interactive prompting with argparse in python?