How to clear the screen in python 3.2 version . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to clear the screen in python 3.2 version .

import os Def clear (): os. system("cls") Clear () Not working any other ideas.

18th Jan 2019, 9:22 PM
AKS
AKS - avatar
7 Answers
+ 8
Sir may you use 3.2.6 version or more It work for them
18th Jan 2019, 9:53 PM
AKS
AKS - avatar
+ 6
Yes sir using python shell to see out put
18th Jan 2019, 9:38 PM
AKS
AKS - avatar
+ 4
ADEVIL, are you on Windows?
18th Jan 2019, 9:37 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 2
ADEVIL, I tried to replicate you situation but it worked for me.
18th Jan 2019, 9:47 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 2
A discussion thread with portable answers: https://stackoverflow.com/questions/2084508/clear-terminal-in-JUMP_LINK__&&__python__&&__JUMP_LINK Spawning a new process may pain some architecturally-minded devs, so it would be nice if you found something that works in the existing terminal context. Note, the confusion over the Ctrl-L answer may be an architectural shortfall or lost knowledge; they don't seem to realize that Ctrl-L usually generates ASCII 12 so sending chr(12) is usually the same thing. [meta, keyboard and ANSI escape / terminal control] Ctrl+key often sends some sensible code to the terminal: ~ Ctrl-A sends chr(1) ~ Ctrl-Z sends chr(26) ~ Ctrl-[ sends char(27)...aka: The ESC key, or hex 1b, used in ANSI escape terminal control sequences. (Compare the position of [ relative to Z--the 26th letter--on an ASCII chart)
20th Jan 2019, 6:48 PM
Kirk Schafer
Kirk Schafer - avatar
0
If ur on windows it should work but if ur using linux or mac use os.system("clear") instead
19th Jan 2019, 5:14 PM
jay
0
Type: Quit(), this will stop the Python console and you could start over
21st Jan 2019, 2:12 AM
Luis Perez
Luis Perez - avatar