mirror of https://github.com/chriskiehl/Gooey.git
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.
22 lines
639 B
22 lines
639 B
import sys
|
|
import argparse
|
|
from gooey import Gooey
|
|
|
|
|
|
sys.argv.extend(['1', '2', '3', '4', '--sum'])
|
|
|
|
# @Gooey
|
|
def main():
|
|
parser = argparse.ArgumentParser(description='Process some integers.')
|
|
parser.add_argument('integers', metavar='N', type=int, nargs="+",
|
|
help='an integer for the accumulator')
|
|
parser.add_argument('--sum', dest='accumulate', action='store_const',
|
|
const=sum, default=max,
|
|
help='sum the integers (default: find the max)')
|
|
|
|
args = parser.parse_args()
|
|
print args.accumulate(args.integers)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|