[Tutor] Clearing the screen
alan.gauld@bt.com
alan.gauld@bt.com
Mon, 14 May 2001 10:05:43 +0100
------_=_NextPart_001_01C0DC55.0E76C710
Content-type: text/plain; charset="iso-8859-1"
I am printing lot of lines to the screen (stdout). If at any point of time,
i want to clear the screen,
is there any command which will help me do this ? [ Other than
os.system('clear') ]
os.system("clear") is probably the best bet because clearing the screen is
very
terminal specific.
You could write a function to lookup terminfo/termcap and send the
appropriate
control sequences, but that's just duplicating what clear does!
Alan G.
------_=_NextPart_001_01C0DC55.0E76C710
Content-type: text/html; charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT face=Arial size=2>I am printing lot of lines to the screen
(stdout). If at any point of time, i want to clear the screen, <SPAN
class=280220509-14052001><FONT color=#0000ff> </FONT></SPAN></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>is there any command which will help me do
this ? [ Other than os.system('clear') ]<FONT color=#0000ff><SPAN
class=280220509-14052001> </SPAN></FONT></FONT></FONT><FONT size=2><FONT
face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001> </SPAN></FONT></FONT></FONT></DIV></BLOCKQUOTE>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001>os.system("clear") is probably the best bet because
clearing the screen is very </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001>terminal specific.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001>You could write a function to lookup terminfo/termcap
and send the appropriate </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001>control sequences, </SPAN></FONT></FONT></FONT><FONT
size=2><FONT face=Arial><FONT color=#0000ff><SPAN class=280220509-14052001>but
that's just duplicating what clear does!</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial><FONT color=#0000ff><SPAN
class=280220509-14052001>Alan G.</SPAN></FONT></FONT></FONT></DIV></BODY></HTML>
------_=_NextPart_001_01C0DC55.0E76C710--