Alfred
Alfred

Reputation: 165

Use variables in another section in Python ConfigParser

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?

Upvotes: 3

Views: 2795

Answers (1)

holdenweb
holdenweb

Reputation: 37043

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

Upvotes: 2

Related Questions