Reputation: 503
I have a build.properties
file like
[directory]
src = src
srcdir = ${src}/fix
srcext = ${srcdir}/extensions
srct = ${srcext}/xyz
my aim is to get the full value of srct
i mean it is to be src/fix/extensions/xyz
Is there any way of getting the value of cde? I tried configparser
and jproperties
but i couldn't get the required output.
Upvotes: 0
Views: 174
Reputation: 24562
You can use ExtendedInterpolation
class which implements more advanced syntax.
>>> from configparser import ConfigParser, ExtendedInterpolation >>> >>> parser = ConfigParser(interpolation=ExtendedInterpolation()) >>> parser.read("build.properties") ['build.properties'] >>> print(parser["directory"]["srct"]) src/fix/extensions/xyz
Upvotes: 2