I love f-strings. Don't forget that you can do fr"some string {blah}" to build raw strings. >>> blah = "something \here" >>> fr"what the {blah}" 'what the something \\here'
1. \h doesn't get interpolated to anything (unlike \a, \b, \f, etc...)
"\h"
'\\h'
"\a"
'\x07'
2. The "r" needs to be in the original definition, not the f-string. blah = r"\a"
You only need the "r" in the f-string if you don't want interpoolation of the "\" - I.e.: fr" this\a {blah}"
'This\\a \\a