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
There is one more way to achieve this i.e by using format and % to replace variables. For example:
format
%
>>> s = '{foo} %(bar)s' >>> s = s.format(foo='my_foo') >>> s 'my_foo %(bar)s' >>> s % {'bar': 'my_bar'} 'my_foo my_bar'