Clearing a DOS terminal in a script

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Fri Dec 14 11:36:25 EST 2007


Stephen_B wrote:
> This doesn't seem to work in a dos terminal at the start of a script:
>
> from os import popen
> print popen('clear').read()
>
> Any idea why not? Thanks.
>   
As others have mentioned, you should just do:

os.system("cls")

Or, you can use my WConio module for fancier work.

http://newcenturycomputers.net/projects/wconio.html

Good luck!

-- Chris.




More information about the Python-list mailing list