[Numpy-discussion] Reading automatically all the parameters from a file

Tony Yu tsyu80 at gmail.com
Wed Nov 30 14:14:39 EST 2011

On Wed, Nov 30, 2011 at 1:49 PM, Neal Becker <ndbecker2 at gmail.com> wrote:

> My suggestion is: don't.
> It's easier to script runs if you read parameters from the command line.
> I recommend argparse.
 I think setting parameters in a config file and setting them on the
command line both have their merits. I like to combine ConfigObj with
argparse; something like:

parser = argparse.ArgumentParser()
<add arguments to parser here>

cfg = configobj.ConfigObj("params_file.cfg")

Then call parser.parse_args, which will override parameters in the config
file by specifying values on the command line.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111130/cd016377/attachment.html>

More information about the NumPy-Discussion mailing list