Is it possible to do partial string formatting with the advanced string formatting methods, similar to the string template safe_substitute()
function?
For example:
s = '{foo} {bar}'
s.format(foo='FOO') #Problem: raises KeyError 'bar'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…