|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Clear Screen
Hi
How do i clear display screen. I know they use cls in "C" programme but in python ? |
|
#2
|
||||
|
||||
|
Dos box or terminal display?
GUI Tkinter,wxPython,PyQt ......? Windows or Linux? Which variant of C uses "cls"? Help us to help you ![]() Grim ![]()
__________________
*** Experimental Python Markup CGI V2 *** |
|
#3
|
|||
|
|||
|
clear screen
Sorry it's clrscr()
in (turbo c) |
|
#4
|
||||
|
||||
|
Code:
def clrscr(): for i in range(1, 50): print
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
|
#5
|
||||
|
||||
|
Comfused, where did the
Code:
def clrscr(): for i in range(1, 50): print come into it . If you search the forums there were some previous threads about this although i think the genenal idea was to use a system command to clear the console - unless where talking about curses in which case you want to look at the curses module:http://www.python.org/doc/2.3.3/lib/module-curses.html EDIT: got ya now, move everything off the screen . Nice idea heheh. You could also use \b about a million times ![]() Mark. Last edited by netytan : April 27th, 2004 at 09:29 PM. |
|
#6
|
||||
|
||||
|
Yep, the trouble with using os.system() is that while system() itself is portable, the command you're running isn't necessarily portable. For DOS, it is called "cls" and for *nix, it is called "clear". Who knows what it is going to be on some other OS. Same with the curses module, which only works on *nix terminals.
This clrscr() function might be a bit naive, but I guess it should work on anything that can print. Might need to increase the range of the loop though . |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Clear Screen |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|