<vi***********@gmail.comescribi�:
Hi;The \ is an escape character inside string literals. '\n' contains a
I have this code:
def a():
chars = ['\\i0', '\\u0', '\\qc', '\\b0', '\\ql', '\\i', '\\u', '\\b',
'\\yz']
rtf_markup = 'viewkind4\uc1\pard\nowidctlpar\qc\i\f0\fs36 Who is like the
Beast? Who can wage war against him?\par'
*single* character and it's the same as chr(10). '\f0' is two characters
long, not three. You have two alternatives:
a) double each \ (because \\ is interpreted as a single backslash):
rtf_markup = 'viewkind4\\uc1\\pard\\nowidctlpar\\qc...'
b) use raw strings - that is, prefix each string literal with a small r:
rtf_markup = r'viewkind4\uc1\pard\nowidctlpar...'
See the tutorial
http://docs.python.org/tut/node5.htm...00000000000000 and the
gory details at http://docs.python.org/ref/strings.html
--
Gabriel Genellina