Is it possible to do partial string formatting with the advanced string formatting methods, similar to the string template safe_substitute() function?
safe_substitute()
F
If you're doing a lot of templating and finding Python's built in string templating functionality to be insufficient or clunky, look at Jinja2.
From the docs:
Jinja is a modern and designer-friendly templating language for Python, modelled after Django’s templates.