I have a LaTeX file I want to read in with Python 3 and format a value into the resultant string. Something like:
...
extbf{REPLACE VALUE HERE}
...
But I have not been able to figure out how to do this since the new way of doing string formatting uses {val}
notation and since it is a LaTeX document, there are tons of extra {}
characters.
I've tried something like:
'extbf{This and that} plus extbf{{val}}'.format(val='6')
but I get
KeyError: 'This and that'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…