I'd like to use Python f-string for its syntactical simplicity, compared to string.Template() or other approach. However, in my application, the string is loaded from file, and the values of the variable can only be provided later.
If there a way to invoke fstring functionality separate from the string definition? Hopefully code below will better explain what I hope to achieve.
a = 5
s1 = f'a is {a}' # prints 'a is 5'
a = 5
s2 = 'a is {a}'
func(s2) # what should be func equivalent to fstring