def vararg_callback(option, opt_str, value, parser):
 value = [value]
 def floatable(str):
  try:
   float(str)
   return True
  except ValueError:
   return False
 for arg in parser.rargs:
  if ((arg[:2] == '--') and (len(arg) > 2)):
   break
  if ((arg[:1] == '-') and (len(arg) > 1) and (not floatable(arg))):
   break
  value.append(arg)
 del parser.rargs[:(len(value) - 1)]
 setattr(parser.values, option.dest, value)

def vararg_callback ( option , opt_str , value , parser ) : value = [ value ] def floatable ( str ) : try : float ( str ) return True except ValueError : return False for arg in parser . rargs : if ( ( arg [ : 2 ] == '--' ) and ( len ( arg ) > 2 ) ) : break if ( ( arg [ : 1 ] == '-' ) and ( len ( arg ) > 1 ) and ( not floatable ( arg ) ) ) : break value . append ( arg ) del parser . rargs [ : ( len ( value ) - 1 ) ] setattr ( parser . values , option . dest , value )
callback for an option with variable arguments .