我无法让 Python Cheetah 为我打印反斜杠。
猎豹2.4.4版
from Cheetah.Template import Template
my_template = """
Stuff $var1\\$var2
"""
t = Template(source=my_template, searchList = [{"var1" : """\\x\y\z""", "var2" : "some"}])
print str(t)
我希望看到输出
Stuff \\x\y\z\some
但我明白了
Stuff \x\y\z$var2
在这种情况下,模板应该是什么?