Last active
November 1, 2019 09:53
-
-
Save JohnnyChiang/438743900728e61eaaa9 to your computer and use it in GitHub Desktop.
windows console killing processes command
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 os | |
#make sure every chromedriver.exe is closed | |
with os.popen('tasklist') as task_list_file: | |
task_list_str = task_list_file.read() | |
flag = task_list_str.find("chromedriver.exe") | |
if flag != -1: | |
os.system("taskkill /F /IM chromedriver.exe") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment