Stephen_B wrote:
> On Dec 13, 11:21 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> It opens "clear" with it's own virtual terminal and clears that
>> instead.
> 
> Even when I launch the script from a cmd shell with "python
> myscript.py"?
> 
>> There's an ANSI control code you can use to reset the screen, try printing 
>> that.
> 
> I googled "<Esc>[2J" as an ascii sequence that it is supposed to clear
> the screen. How do I send that?
> 
> Stephen
Normally you would do:

import sys
sys.stdout.write(chr(27)+'[2J')
sys.stdout.flush()

Unfortunately that doesn't clear the screen because the ANSI module isn't 
loaded 
by default.  Use os.system('cls') as mentioned instead.

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

Reply via email to