+ 2
how to clear screen in python shell windows 10?
clear , clear() and os.sytem('cls') not working
6 Respostas
+ 13
Kuba SiekierzyĆski đđđ
+ 6
If you want your code to run both on Linux and Windows use this đ
import os
# using ternary operator đ
os.system('cls' if os.name=='nt' else 'clear')
đ
+ 5
print('\n'*40)
# ;)
+ 5
Nishant Looks like you didn't import os first! đź
# First import os module đ
import os
# Then use đ
os.system('cls') # if you are on Windows else use 'clear' đ
đ
+ 2
import os
os.system('cls') # on windows
or
os.system('clear') # on linux / os x
0
error : name 'os' is not defined