Am 27.10.2010 10:44, schrieb aspineux:
> I have text files formated using spaces and want to render them
> in a genshi template.
> I use this
>
> <span py:for="line in attachment.split('\n')">
> ${line}<br/>
> </span>
>
> but I need to replace multiple spaces using unbreacable spaces
> " ". I also would like to replace tab ('\t' ) by the
> appropriate number of spaces.
Why don't you put the whole stuff in a <pre></pre> section?
Replacing tabs is as easy as attachment.replace('\t', n*' ').
-- Christoph
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.