Can Python clear a DOS screen?

Dan Rolander dan.rolander at marriott.com
Fri Jan 19 04:17:02 EST 2001


Thank you both Fredrik and Sam,

I don't know why I didn't see that. I should have been able to figure it
out.

Thanks for taking the time to help me.

Dan

----- Original Message -----
From: "Fredrik Lundh" <fredrik at effbot.org>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Thursday, January 18, 2001 5:22 PM
Subject: Re: Can Python clear a DOS screen?


> Dan Rolander wrote:
> > I've got a Python script that writes to a DOS console. Is it possible to
> > have the script clear the screen?
>
>     os.system("cls")
>
> (it's as stupid as it looks, but it works everywhere.
> print "\x1a[2J" can also work, but it usually doesn't)
>
> For better control, consider using a console driver.
> here's one:
>
>     http://effbot.org/efflib/console
>
> Cheers /F
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list