Ask coding questions

← Back to all posts
how to clear py console?
Windows10c

i don't no how to clear py console
i want create windows os

Voters
ReubenAndrews
cdCreepArghhh
Windows10c
Comments
hotnewtop
firefish

to clear console, just do

Windows10c

@firefish Thanks

cdCreepArghhh

To stop newline from appearing after you clear, use

instead

widz

import os

#on linux or mac
os.system(‘clear’)

#on windows
os.system(‘cls’)

cdCreepArghhh

@widz The other answer is easier, as doing that would involve more lines of code:

Whereas you could just use one print statement as @firefish stated in the other answer.