Michael M Mason wrote:
Dave Angel wrote on 11 August 2009 at 16:42:-
The brute-force way might be to replace each space in "l" with
which is a "nonbreaking space." But I think you want the
<pre>
tag, which means the text is pre-formatted. And you could put that
around the whole sorce file, instead of doing <p> for each line.
I think the <pre> tag will work, but it will force the font to be
monospaced, overriding the "<font=ial,fontsize=8>" tag that the OP has
included.
That font= syntax was probably bogus. But in any case, I meant to put
the <pre> around each sorce file expansion, not around the whole
destination file, and implied that the <p> and </p> lines go away.
Something like:
dest.write('<h1>
dest.write(x)
dest.write('</h1>')
dest.write("<pre>")
for l in sorce:
dest.write(l)
sorce.close()
dest.write("</pre>")
DaveA
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor