I find the following interesting error:
parser.add_option("-n", "--number", metavar="NUMBER", type="int", help="number is NUMBER") (options, args) = parser.parse_args() if options.number:
After some time, it turned out that my application does not work if the number is 0 , but this should be a valid number (it should be> = 0). The problem is that 0 is False .
should I change it to:
if options.number is not None:
or something more complicated?
xralf source share