W
W
Web__Nikita032019-06-21 11:52:13
Python
Web__Nikita03, 2019-06-21 11:52:13

Why is it spelled like this?

os.system('cls' if os.name == 'nt' else 'clear')
Why is it necessary to display cls in Windows if the clear command works well?
Or is it because I have git bash installed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-06-21
@Web__Nikita03

This is because you have git bash installed. In cmd, the command to clear the console is cls. There is no clear command or utility in Widnows by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question