Skip to content

Instantly share code, notes, and snippets.

@JohnnyChiang
Last active November 1, 2019 09:53
Show Gist options
  • Save JohnnyChiang/438743900728e61eaaa9 to your computer and use it in GitHub Desktop.
Save JohnnyChiang/438743900728e61eaaa9 to your computer and use it in GitHub Desktop.
windows console killing processes command
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