Newbie question: non-escaping backslashes before placeholders
Jon Mills <[email protected]> Thu, 22 Oct 2009 06:21:34 +0100
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm new to Cheetah, and new to this list,
I've got a question that I'm sure must have been asked before, but I
can't find the answer in the documentation so I'm hoping somebody can
help.
I'm using Cheetah 2.2.1 / Python 2.5 under Windows to create some
config files and I'm having problems creating windows paths.
There's a cut-down example below.
from Cheetah.Template import Template
t = Template('#config_file "c:\$p1\$p2"')
t.p1 = 'foo'
t.p2 = 'bar'
print t
This outputs the following:
#config_file "c:$p1$p2"
What I really want is
#config_file "c:\foo\bar"
I can't figure out how to prevent the backslashes from escaping the
following placeholder. I'm sure there's a simple answer.
Thanks in advance.
Jon Mills
[email protected]
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference