Last active
June 14, 2018 06:52
-
-
Save qzcool/6ece1b938298baa8eeef8ef7a1e2d6e3 to your computer and use it in GitHub Desktop.
[Windows] program kill functions, currently including Excel and Chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
# Chrome App Kill | |
def kill_chrome(): | |
for proc in psutil.process_iter(): | |
if 'chrome.exe' in proc.name(): | |
proc.kill() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psutil | |
# Excel App Kill | |
def kill_excel(): | |
for proc in psutil.process_iter(): | |
if 'EXCEL.EXE' in proc.name() or 'Microsoft Excel' in proc.name(): | |
proc.kill() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment