printing indented html code

Lowell Kirsh lkirsh at cs.ubc.ca
Fri Jun 24 09:38:48 CEST 2005


Is there a module or library anyone knows of that will print html code 
indented? What I'd like would be for a function or class which works 
like this:

htmlIndent(sys.stdout, '<html><head>foobar</head>...')

and will print somethinkg like this to stdout:

<html>
   <head>
     foobar
   </head>
   ...

My current way of doing this kind of stuff is less than ideal and will 
write such a function if it doesn't exist.

Thanks,
Lowell



More information about the Python-list mailing list