Cgi: Print Text files with wordwrap!

Dale Strickland-Clak dale at
Thu Mar 11 01:01:47 CET 2004

Walter Huf pushed the bounds of literature with:

> Okay, I'm writing a cgi program, and I can send files and stuff, but
> how do I send text files with word wrap enabled? If a line of text is
> wider than the browser, and unsightly scrollbar appears on the bottom.
> How would I make it so that the text automatically wraps in the
> browser without putting a whole bunch of linebreaks in the text file?
>   --Walter Huf--
> hufman at
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> - The #1 Newsgroup Service in the World!
> -----==  Over 100,000 Newsgroups - 19 Different Servers! =-----

If you send plain text, it will be presented exactly how you send it, line 
breaks and all.

If you want it to wrap to the browser window, you have to make it look 
like HTML. The bare minimum you can get away with is <p> tags where you 
want new paragraphs - plus a head and a tail.

Dale Strickland-Clark
Riverhall Systems Ltd,

More information about the Python-list mailing list