[Tutor] Re: clear screen [Let's make a feature request in Sourceforge!]

lumbricus@gmx.net lumbricus@gmx.net
Thu Nov 14 13:00:26 2002


Hi!
 
[ snip ]

> class _cls:
>     def __init__(self):
>         if sys.platform in ('linux-i386', 'linux2'):
>             self._command = 'clear'

There are more UNICES than Linux.
As I wrote in an earlier post IMHO os.name is the
better choice, because it just spits out 'posix'
for all the different UNICES out there. 

>         elif sys.platform in ('win32', 'dos') or \
>              sys.platform.startswith('ms-dos'):
>             self._command = 'cls'

Same principle applies.

>         else:
>             self._command = None

sys.platform
'osf1V4'

So your code would fail on my machine, while
it understands "clear" perfectly well.
 
[ snip ]

> I can't confirm that it works on Win32 yet; can someone check this?  Once
> it checks out ok, we can submit this to Python's sourceforge as a feature
> request.  Who knows?  It might get in...

IMHO clearing the screen at the beginning of a console program
is a bad habit. You loose information and gain nothing.

> I hope this helps!

Dito, J"o!

-- 
Wir beschliessen etwas, stellen das dann in
den Raum und warten dann einige Zeit ab, was
passiert. Wenn es dann kein grosses Geschrei
gibt und keine Aufstaende, weil die meisten
gar nicht begreifen, was da beschlossen
wurde, dann machen wir weiter - Schritt fuer
Schritt, bis es kein Zurueck mehr gibt. 
   -- J-C Juncker

+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!