With Python ConfigParser, is it possible to use interpolation across foreign sections? My mind seems to tell me I’ve seen that it’s possible somewhere, but I can’t find it when searching.
This example doesn’t work, but it’s to give an idea of what I’m trying to do.
[section1]
root = /usr
[section2]
root = /usr/local
[section3]
dir1 = $(section1:root)/bin
dir2 = $(section2:root)/bin
Note that I’m using Python 2.4.
In python 3.2 and up this is perfectly valid:
Edit:
I just saw that you are using python 2.4, so no, section interpolation cannot be done in python 2.4. It was introduced in python 3.2 – See section 13.2.5 – ConfigParser Interpolation of values.