[Python-ideas] Fwd: argparse - add support for environment variables

Mark Hackett mark.hackett at metoffice.gov.uk
Fri Feb 22 12:26:55 CET 2013


On Thursday 21 Feb 2013, Miki Tebeka wrote:
> > What about config files? Mix them into argparse too? Oh, and support for
> > .ini/XML/YAML/JSON/sqlite configs, please!
> 
> Well, baby steps toward configuration solution :)
> The other thing is that unlike config files which have many formats,
> environment has one uniform access to it.
> 

In the interests of doing it the UNIX way, would this be better done as a 
parser for the .ini/XML/YAML (they're ALL YAML, though. Yet ANOTHER Meta 
Language..!) that results in $ENV changing in python.

Send the result that to argparse.

Bada-bum, bada-bing, done.



More information about the Python-ideas mailing list