0

Clearscreen in python language

how to Clearscreen in python shell or cmd... like cls in cmd.... clc in MATLAB.... clrscr() in c and c++

15th Jul 2017, 9:23 PM
Keerthivasan Gnanaudayan
Keerthivasan Gnanaudayan - avatar
3 Réponses
+ 4
import os os.system('clear') # but this could not work anywhere... # however, you can also do: cls = '\33[2J\33[H' print(cls+'test') """ ... which could ever not work sometimes, but got more probability to work as expected. First sequence if escaped terminal command clear screen, and second position cursor at first row, first line (safer, as not always done by clear screen command ^^) Well, but you must know that all that kind of stuff doesn't work at all in code playground, due to limitations of in/output :P """
15th Jul 2017, 10:39 PM
visph
visph - avatar
0
Try something like that: import os def cls(): os.system('cls') cls()
15th Jul 2017, 10:20 PM
Boris Batinkov
Boris Batinkov - avatar
0
I tried it by seeing in Google but doesn't clears the screen
15th Jul 2017, 10:21 PM
Keerthivasan Gnanaudayan
Keerthivasan Gnanaudayan - avatar