You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
573 B

10 years ago
  1. import argparse
  2. from gooey import Gooey
  3. @Gooey
  4. def main():
  5. parser = argparse.ArgumentParser(description='Process some integers.')
  6. parser.add_argument('integers', metavar='N', type=int, nargs='+',
  7. help='an integer for the accumulator')
  8. parser.add_argument('--sum', dest='accumulate', action='store_const',
  9. const=sum, default=max,
  10. help='sum the integers (default: find the max)')
  11. args = parser.parse_args()
  12. print args.accumulate(args.integers)
  13. if __name__ == '__main__':
  14. main()