+ 5
How to clear the screen in python 3.2 version .
import os Def clear (): os. system("cls") Clear () Not working any other ideas.
7 Respostas
+ 8
Sir may you use 3.2.6 version or more It work for them
+ 6
Yes sir
using python shell to see out put
+ 4
ADEVIL, are you on Windows?
+ 2
ADEVIL, I tried to replicate you situation
but it worked for me.
+ 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)
0
If ur on windows it should work but if ur using linux or mac use os.system("clear") instead
0
Type: Quit(), this will stop the Python console and you could start over