I need to read the following configuration file in yaml format:
version: 1 disable_existing_loggers: False formatters: precise: format: "%(name)-15s # %(levelname)-8s # %(asctime)s # [Line: %(lineno)-3d]: %(message)s" datefmt: "%Y-%m-%d %H:%M:%S" handlers: file: class: logging.handlers.RotatingFileHandler filename: <%= ENV['ENV_PROJECT'] %>/target/tracing.log encoding: utf-8 maxBytes : 10737418244 backupCount: 7 formatter: precise loggers: utility: handlers: [file] level: INFO propagate: True root: handlers: [file] level: INFO
But instead, <% = ENV ['ENV_PROJECT']%> in the result line I need, for example, to get the corresponding path. To download this file, I use the following code:
from yaml import load with open('test.yml', 'rt') as stream: configuration = load(stream)
How can I get the desired result? Tnx.
Yigal source share