'what are ${} in config.ini
I've been reading code base develop by someone else. In one of the config_file.ini it contains
[key]
id = John
pwd = 123123
server = ${common:prefix}server_name
What exactly is ${} doing? Also if there is reference that talks about it please let me know.
Solution 1:[1]
It's documented under configparser.ExtendedInterpolation. It's a syntax(${section:option}) to denote a value from a foreign section. For example, in the following config file the path option also refers to the system_dir value from Common section.
[Common]
home_dir: /Users
library_dir: /Library
system_dir: /System
macports_dir: /opt/local
[Frameworks]
Python: 3.2
path: ${Common:system_dir}/Library/Frameworks/
^^^^^^^^^^^^^^^^^^^^
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
