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
593 B

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