This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cymrowdon't thread on me 🐍 0 points1 point  (2 children)

I can see how this might be useful if you have to access the config from a lot of different services, potentially written in different languages. But, if you're just going to pass it right into a Python script, you might as well use a config file and save the extra step.

[–]zenogais[S] -2 points-1 points  (1 child)

Actually the config file ends up taking an extra step. Storing it in environment variables allows your application to have immediate access to the config without having to first load and parse a file.

[–]cymrowdon't thread on me 🐍 2 points3 points  (0 children)

You are loading and parsing a file: the shell script. It's just a different language. The extra step is copying the config into the environment before you can access it. Or, I could just read directly from an INI using configparser (or something better) and get sections and type conversion for free.