better way than: myPage += 'more html' , ...

Brainwashed vald at valis.amber.eu.org
Thu Jun 26 13:59:00 EDT 2003


On Thu, Jun 26, 2003 at 05:51:43PM +0000, Chuck Spears wrote:
> I have a question with regards to the sprintf style of replacing
> strings.  I have a table in my HTML with a 50% width specifier.  How
> can i get the formatter to ignore it.  For example in the example
> below how can i code the 50% to be ignored?
> 
> keep the "%s 50% %s" % ("a","b")

This problem is very similar to the one I had and wrote about it
here yesterday. By the way, thanks for help! :)
You have to use regexps or something else to replace '50%' and any
other width specifiers you don't want to be formated by % operator
with '50%%' - double % means that it will be considered as normal
'%' character by Python's formatter.

--
0x76616c64





More information about the Python-list mailing list