risposta

3

Né agrparse né optparse supporta questo.

0

Sì, è possibile:

#!/usr/bin/env python 
# coding: utf-8 

from argparse import ArgumentParser 

parser = ArgumentParser(description='Argparse with numeric arguments') 
parser.add_argument('-0', action='store_true', help='null separator') 
args = parser.parse_args() 
print vars(args)['0'] 
Problemi correlati