On Mon, Oct 20, 2008 at 3:13 AM, Alan Gauld <[EMAIL PROTECTED]>wrote:

> "Chris Fuller" <[EMAIL PROTECTED]> wrote
>
>  want to clear the screen, printing the control sequence ESC[2J is all you
>> need.
>>
>>  print chr(0x1b) + '[2J'
>>>>>
>>>>
I don't know if this is the most graceful solution... but it seems to work:
import os

if os.system('cls') == 0:
    pass
elif os.system('clear') == 0:
    pass
else:
    print 'No clear command available'

That should take care of most of your OS' out there...

HTH,
Wayne

-- 
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn't. - Primo Levi
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to