Re: Escape character problem

"Saranakom Cheecharoen" <[email protected]> Tue, 22 Feb 2011 11:18:57 +0700
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
Thanks, Jean-Baptiste Quenot.

I have many things to learn more in Python.

Regards,
Long

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Jean-Baptiste Quenot
Sent: Monday, February 21, 2011 11:46 PM
To: Saranakom Cheecharoen
Cc: [email protected]
Subject: Re: [Cheetahtemplate-discuss] Escape character problem

This is a very creative way of using Cheetah, congratulations!

No, seriously, I would use Python's built-in dictionary-style string
formatting for this:

>>> "%(COMM_BUS)s\\Pass through\\%(eDME)s_max.pkg" % {'COMM_BUS': 
>>> 'A_CAN', 'eDME': '123'}
'A_CAN\\Pass through\\123_max.pkg'
--
Jean-Baptiste Quenot


------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev