Can Python clear a DOS screen?

Paul Hughett hughett at mercur.uphs.upenn.edu
Sat Jan 20 14:12:21 EST 2001


Rolander, Dan <Dan.Rolander at marriott.com> wrote:
: I've got a Python script that writes to a DOS console. Is it possible to
: have the script clear the screen?

It's been about 10 years since I've done this, and it wasn't in Python,
so you will have to work out the details yourself.

If you load the ANSI.SYS module, then the console will interpret most
of the ANSI escape sequences for modifying the screen.  Among these is
an escape sequence for clearing the screen.

Paul Hughett




More information about the Python-list mailing list