<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi all,
>
> I have a simple snippet I am trying to keep the format the same as
> plain text, though I want to embed it in html ...
>
> basically,
>
> print "Content-type:text/plain\n\n";
> getrup = os.popen('ruptime').read()
> print getrup
>
> is the same format as if I ran 'ruptime' from the command line.
>
> If I use...
>
> print "Content-type:text/html\n\n";
> getrup = os.popen('ruptime').read()
> print getrup
>
> I can just split the lines and loop through it ... but I am not sure
> how to keep the tab spacing the same
> I'm sure its something so simple I am missing ....
>
> thanks for helping someone learning..
> --mike
>
What about :

print "Content-type:text/html\n\n";
print "<pre>"
getrup = os.popen('ruptime').read()
print getrup
print "</pre>"

The <pre> tags indicate that the enclosed text has been pre-formatted.
Otherwise your tabs will get collapsed out by HTML.

-- Paul


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to