hpcflow.sdk.core.utils.substitute_string_vars#
- hpcflow.sdk.core.utils.substitute_string_vars(string, variables)#
Scan
stringand substitute sequences like<<var:ABC>>with the value looked up in the supplied dictionary (withABCas the key).Default values for the substitution can be supplied like:
<<var:ABC[default=XYZ]>>Examples
>>> substitute_string_vars("abc <<var:def>> ghi", {"def": "123"}) "abc 123 def"