3

I know I can use %(values)s to use the exist variable in the config file. But it seems that I can only use the variable in the same section. Is there any way to use the variable in other sections?

1 Answer 1

2

Take a look at extended interpolation. This allows you to use the ${section:option} syntax to refer to values from other sections.

Sign up to request clarification or add additional context in comments.

2 Comments

It works quite well in python 3 but it doesn't work in python 2.
Oh, boo. This seems a suitable candidate for a backport, I don't see why it wouldn't work in Python 2. Sorry!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.