[Tutor] To write data in two different fonts?

Dave Angel davea at ieee.org
Wed Aug 12 01:41:51 CEST 2009


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


More information about the Tutor mailing list