Reputation: 169
When I tried to clear the python shell with using following python commands.
import os
os.system("cls")
It always returned -1. Then I tried os.system() for different inputs. like,
os.system("cd ..")
os.system("mkdir hello")
But it fails all the time and returns -1. Why is it so?
Upvotes: 1
Views: 424
Reputation: 169
I found a solution for this problem. I am posting the solution if someone faces the same problem in future.
In my case, environment variable ComSpec was modified automatically by Microsoft SQL server update. I did modify it to the previous value, that was "%SystemRoot%\system32\cmd.exe". After modifying this environment variable, logoff and login again.
Upvotes: 1