What version of python are you using. With python 3.8.5
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