Re: [Tutor] passing named arguments through command line

2014-10-31 Thread Robert Sokolewicz
cool, thanks guys :) -Robert On Thu, Oct 30, 2014 at 7:24 PM, Danny Yoo wrote: > > > On Thu Oct 30 2014 at 7:58:32 AM Lukas Nemec wrote: > >> Hello, >> >> take a look at argparse library. >> > > > Hi Robert, > > As Lukas mentions, it sounds like you're looking for a "flag parsing" > library.

Re: [Tutor] passing named arguments through command line

2014-10-30 Thread Danny Yoo
On Thu Oct 30 2014 at 7:58:32 AM Lukas Nemec wrote: > Hello, > > take a look at argparse library. > Hi Robert, As Lukas mentions, it sounds like you're looking for a "flag parsing" library. A flag parsing library reads a set of key/value pairs that are encoded in sys.argv, so they let comman

Re: [Tutor] passing named arguments through command line

2014-10-30 Thread Lukas Nemec
Hello, take a look at argparse library. --- import argparse parser = argparse.ArgumentParser(description="My prgoram") parser.add_argument('-y', '--y', help="Y value", required=True) parser.add_argument('-x', '--x', help="X value", required=True) def main(x=1, y=2): print x print