>>>>> lkenne...@gmail.com (l) wrote:

>l> Here is the code and as you can see for yourself, the output is not
>l> coming out on the screen with CRLF like it should.  How do I fix this?

Don't use curses.

Curses puts the terminal in raw mode (more or less) which doesn't
translate the newline character into CRLF. If you use curses you are
supposed to do all output through curses. But the os.system goes
directly to the screen, outside of curses (because it is another
process).
You could catch the output of ls -l with a PIPE and then write the
output to the curses screen with addstr. But a curses screen has a
limited length, whereas your ls -l output may be larger so then you must
implement some form of scrolling.

>l> import curses, os
>l> screen = curses.initscr()
>l> os.system("ls -l")
>l> curses.endwin()

-- 
Piet van Oostrum <p...@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to