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
You could wrap it in a function that takes default arguments:
def print_foo_bar(foo='', bar=''): s = '{foo} {bar}' return s.format(foo=foo, bar=bar) print_foo_bar(bar='BAR') # ' BAR'