printing indented html code

TechBookReport tbr at nospam.nos
Fri Jun 24 06:26:57 EDT 2005


Lowell Kirsh wrote:
> 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

There are lots of HTML pretty printers around, but for starters take a 
look at this: http://www.oreilly.com/catalog/pythonsl/chapter/ch05.html

HTH
==========================================================================
TechBookReport - http://www.techbookreport.com



More information about the Python-list mailing list