How to kill the calculator application on windows with python

0

I've opened the calculator on windows, Windows 8 to be particular I'm using python 3.7.3 and I wanted to close the calculator application so I wrote the following code

os.system('TASKKILL /F /IM calculator.exe')

What weird thing happened is that it didn't give any error but returned '128' and this returned every time.

os.system('TASKKILL /F /IM notepad.exe')

This worked correctly i.e. while closing the notepad application

Kamalesh Pathy

Posted 2019-06-11T14:43:52.763

Reputation: 13

Answers

0

I think the executable is calc.exe. I am on windows 10 but I think it should be the same on other versions of windows too.

Randomhero

Posted 2019-06-11T14:43:52.763

Reputation: 804