[Tutor] To write data in two different fonts?

prasad rao prasadaraon50 at gmail.com
Tue Aug 11 16:38:53 CEST 2009


Hello
 I modified my code.But I am gettingmy my lines stripped of indentation.
What should I do to avoid it?Sorry if it is not about Python.

<code>


def sc(adir):
       import os,myfiles
       dest=open('C:/scripts.html','w')
       s=myfiles.myfiles(adir)
       dest.write('<html>')
       for x in s:
              if os.path.isfile(x):
                  sorce=open(x,'r')

                  dest.write('<h1><font=Helvetica,fontsize=14>')
                  dest.write(x)
                  dest.write('</h1>')


                  for l in sorce:
                       dest.write('<p><font=Arial,fontsize=8>')
                       dest.write(l)
                       dest.write('</p>')
                  sorce.close()
              else:pass
       dest.write('</html>')
       dest.close()

</code>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090811/d0592076/attachment-0001.htm>


More information about the Tutor mailing list