News for hackers. Stuff that matters.
Re:A practical usage of ChainMap in Python by mixmastamyk on Monday September 24, 2018 @02:38PM (#18060164)
There are a few modules on PyPI (env, ezenv) that make the environment lookup portion more convenient/robust, by selecting a prefix for your application config. (Or write it yourself.) A prefix function that returns a mapping with the keys sliced and lowercased, works like this:

    >>> env.prefix('XDG_')
    {'config_dirs': '…', 'current_desktop': '…', 
     'session_type': 'x11', 'vtnr': '7', …}

There are no comments on this comment yet.